[Bug tree-optimization/17510] New: -fstrict-aliasing triggers miscompilation

rguenth at tat dot physik dot uni-tuebingen dot de gcc-bugzilla@gcc.gnu.org
Wed Sep 15 20:51:00 GMT 2004


The attached testcase is miscompiled using
-O2 -static --param max-inline-insns-single=800 --param
large-function-insns=5000 --param inline-unit-growth=100000
and works ok adding -fno-strict-aliasing.

The testcase is instrumented with leafify attributes and with a supporting
compiler (patch attached) the problem can be reproduced with just -O2 vs. -O2
-fno-strict-aliasing and -O1 -fstrict-aliasing vs. -O1.

The failure manifests as a segmentation fault during the first iteration, run
the program with "-n 10" commandline.

The segmentation fault occours at different places depending on optimization
level (-O1 vs. -O2) and inlining heuristics (leafify or the large inlining
parameters).  This may hint at stack allocating/aliasing problems and not
of the actual code.

See also thread starting at
http://gcc.gnu.org/ml/gcc/2004-09/msg00904.html
for some initial tree-dump differences.

-- 
           Summary: -fstrict-aliasing triggers miscompilation
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at tat dot physik dot uni-tuebingen dot de
                CC: dnovillo at redhat dot com,gcc-bugs at gcc dot gnu dot
                    org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17510



More information about the Gcc-bugs mailing list