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

             Bug #: 52525
           Summary: compiler segmentation fault when building OpenMP code
                    with -O3
    Classification: Unclassified
           Product: gcc
           Version: 4.4.6
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: sin.pec...@gmail.com


An -O3 optimization seems to make gcc 4.4.x choke with a segfault while
compiling some OpenMP code. The same code compiles with -O2. Strangely enough,
it also compiles with -O2 + the additional -O3 flags listed in the 4.4.6 docs
(-finline-functions, -funswitch-loops, -fpredictive-commoning,
-fgcse-after-reload, -ftree-vectorize and -fipa-cp-clone).

The bug is not present neither in 4.3 nor 4.5, 4.6.

Marked with major severity as this code will be part of the next version of
GROMACS, the OSS HPC molecular simulation package shipped by several distros
and running on lots of machines from desktops to the largest clusters.


Tested with: 
Ubuntu 10.04 x86_64, gcc-4.4 (Ubuntu 4.4.6-3lucid2) 4.4.6
Ubuntu 11.10 x86_64, gcc-4.4 (Ubuntu/Linaro 4.4.6-11ubuntu2) 4.4.6
RHEL 6.0 x86_64, gcc (GCC) 4.4.4 20100726 (Red Hat 4.4.4-13)

Attached is the input that reproduces the segfault by running:

$ gcc-4.4 -fopenmp -O3 force.i 
/home/pszilard/projects/gmx/gromacs-gpu/src/mdlib/force.c: In function
‘do_force_lowlevel.omp_fn.0’:
/home/pszilard/projects/gmx/gromacs-gpu/src/mdlib/force.c:448: internal
compiler error: Segmentation fault

Reply via email to