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

           Summary: [C++0x] ICE: OMP parallel for with template constexpr
                    function, LTO and debug options.
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: fl...@flast.jp


Using OMP parallel for with template constexpr function (but it won't be
constexpr), non-constexpr variable, -flto option and -g option, GCC will be ICE
in following code.

==== testcase.cc ====
#include <omp.h>

template < typename T >
constexpr int f( T ) { return 0; }

int main()
{
    int x;
#pragma omp parallel for
    for ( int i = 0; i < f( x ); ++i );
}
====

However, when *x* (in main function) is constexpr, GCC won't be ICE.

==== output ====
$ g++-4.6 -g -std=c++0x -fopenmp -flto testcase.cc
testcase.cc: In function 'main._omp_fn.0':
testcase.cc:9:9: internal compiler error: in lhd_set_decl_assembler_name, at
langhooks.c:158
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
====

gcc-4.5 (GCC) 4.5.4 20110512 (prerelease) - OK
gcc-4.6 (GCC) 4.6.1 20110513 (prerelease) - Crash
gcc-4.7 (GCC) 4.7.0 20110517 (experimental) - Crash

Reply via email to