Author: bojan
Date: Wed Jun  4 22:59:10 2008
New Revision: 663466

URL: http://svn.apache.org/viewvc?rev=663466&view=rev
Log:
Backport r663454 from the trunk.
Make input brigade volatile in order to give hints to GCC.
Revert -fno-strict-aliasing, which breaks some compilers.

Modified:
    httpd/apreq/branches/v2_10/CHANGES
    httpd/apreq/branches/v2_10/acinclude.m4
    httpd/apreq/branches/v2_10/library/parser_multipart.c

Modified: httpd/apreq/branches/v2_10/CHANGES
URL: 
http://svn.apache.org/viewvc/httpd/apreq/branches/v2_10/CHANGES?rev=663466&r1=663465&r2=663466&view=diff
==============================================================================
--- httpd/apreq/branches/v2_10/CHANGES (original)
+++ httpd/apreq/branches/v2_10/CHANGES Wed Jun  4 22:59:10 2008
@@ -61,7 +61,7 @@
   Perl upload test (reported by Steve Hay)
 
 - Build [Philip M. Gollucci, Bojan Smojver, joes]
-  add -fno-strict-aliasing to all compiles on all systems
+  make input brigade volatile in order to give hints to GCC
   https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=193740
   This fixes an infinite look split_on_bdry() of library/parser_multipart.c
   particularly on linux/gcc 4.x platforms.

Modified: httpd/apreq/branches/v2_10/acinclude.m4
URL: 
http://svn.apache.org/viewvc/httpd/apreq/branches/v2_10/acinclude.m4?rev=663466&r1=663465&r2=663466&view=diff
==============================================================================
--- httpd/apreq/branches/v2_10/acinclude.m4 (original)
+++ httpd/apreq/branches/v2_10/acinclude.m4 Wed Jun  4 22:59:10 2008
@@ -214,7 +214,6 @@
                       ])
                 # -Wdeclaration-after-statement is only supported on gcc 3.4+
         fi
-        APR_ADDTO([CFLAGS], "-fno-strict-aliasing")
 
         APR_ADDTO([CPPFLAGS], "`$APR_CONFIG --cppflags`")
 

Modified: httpd/apreq/branches/v2_10/library/parser_multipart.c
URL: 
http://svn.apache.org/viewvc/httpd/apreq/branches/v2_10/library/parser_multipart.c?rev=663466&r1=663465&r2=663466&view=diff
==============================================================================
--- httpd/apreq/branches/v2_10/library/parser_multipart.c (original)
+++ httpd/apreq/branches/v2_10/library/parser_multipart.c Wed Jun  4 22:59:10 
2008
@@ -162,11 +162,18 @@
              * so we can move previous buckets across
              * and retest buf against the full bdry.
              */
+
+            /* give hints to GCC by making the brigade volatile, otherwise the
+             * loop below will end up being endless. See:
+             * https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=193740
+             */
+            apr_bucket_brigade * volatile in_v = in;
+
             do {
-                apr_bucket *f = APR_BRIGADE_FIRST(in);
+                apr_bucket *f = APR_BRIGADE_FIRST(in_v);
                 APR_BUCKET_REMOVE(f);
                 APR_BRIGADE_INSERT_TAIL(out, f);
-            } while (e != APR_BRIGADE_FIRST(in));
+            } while (e != APR_BRIGADE_FIRST(in_v));
             off = 0;
             goto look_for_boundary_up_front;
         }


Reply via email to