[Bug c++/49056] New: [C++0x] ICE: OMP parallel for with template constexpr function, LTO and debug options.
flast at flast dot jp
gcc-bugzilla@gcc.gnu.org
Thu May 19 01:17:00 GMT 2011
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: unassigned@gcc.gnu.org
ReportedBy: flast@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
More information about the Gcc-bugs
mailing list