The following (IMHO valid) code snippet triggers an ICE on mainline when
compiled with "-fopenmp":

==========================================
template<int> void foo()
{
#pragma omp parallel for
  for (auto i=0; i<4; ++i) ;
}
==========================================

bug.cc: In function 'void foo()':
bug.cc:4: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

Without the template I get the following error message:

bug.cc: In function 'void foo()':
bug.cc:4: error: declaration of 'auto i' has no initializer
bug.cc:4: error: invalid type for iteration variable 'i'

which seems to be wrong because "i" has an initializer.

Without "-fopenmp" both versions compile fine.


-- 
           Summary: [4.4 regression] ICE with auto and #pragma omp parallel
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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

Reply via email to