I consistently get the following ICE on this C++ code. omp_harness.cpp:39: internal compiler error: in omp_add_variable, at gimplify.c:4257 The code is not legit and there are several errors but this is because I have cut down a larger program. I am using the gomp-branch and gcc -v reports: Using built-in specs. Target: i686-pc-linux-gnu Configured with: ../gomp-20050608-branch/configure --prefix=/local_scratch/owe043/gcc_gomp Thread model: posix gcc version 4.2.0-gomp-20050608-branch 20060216 (experimental) (merged 20060216) The command line I used to compile was: g++ -save-temps -fopenmp omp_harness.cpp
Created attachment 10999 [details] preprocessed output from save-temps that triggers ICE GZIP compressed to make it within the size limit. Will try and make a smaller example that doesn't involve valarray or iostreams.
Created attachment 11000 [details] simpler preprocessed C++ code that causes ICE Removed include of valarray and iostream to produce simpler preprocessed C++ code that still triggers ICE.
Also happens on the mainline now. Reducing.
Confirmed, reduced testcase: int t; void search() { #pragma omp parallel for for (int i = 0; i < 1000; ++i) try { mm::print(t); }catch(...){} }
This is actually ICE on valid, a small modification of the testcase that makes it valid still ICEs.
Subject: Bug 26611 Author: jakub Date: Fri Mar 24 16:14:40 2006 New Revision: 112351 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=112351 Log: PR middle-end/26611 * gimplify.c (gimplify_bind_expr): Only call omp_add_variable on non-global variables that don't have DECL_SEEN_IN_BIND_EXPR_P bit set yet or weren't marked as local yet. * g++.dg/gomp/pr26611-1.C: New test. * g++.dg/gomp/pr26611-2.C: New test. Added: trunk/gcc/testsuite/g++.dg/gomp/pr26611-1.C trunk/gcc/testsuite/g++.dg/gomp/pr26611-2.C Modified: trunk/gcc/ChangeLog trunk/gcc/gimplify.c trunk/gcc/testsuite/ChangeLog
Fixed in SVN.