Bug 26611 - openmp gomp ICE at gimplify.c:4257
Summary: openmp gomp ICE at gimplify.c:4257
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, monitored, openmp, patch
Depends on:
Blocks:
 
Reported: 2006-03-08 22:30 UTC by Bowie Owens
Modified: 2006-03-27 16:12 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-03-23 19:54:07


Attachments
preprocessed output from save-temps that triggers ICE (112.34 KB, application/x-gzip)
2006-03-08 22:34 UTC, Bowie Owens
Details
simpler preprocessed C++ code that causes ICE (787 bytes, text/plain)
2006-03-08 22:39 UTC, Bowie Owens
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bowie Owens 2006-03-08 22:30:48 UTC
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
Comment 1 Bowie Owens 2006-03-08 22:34:21 UTC
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.
Comment 2 Bowie Owens 2006-03-08 22:39:52 UTC
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.
Comment 3 Andrew Pinski 2006-03-09 18:33:25 UTC
Also happens on the mainline now.  Reducing.
Comment 4 Andrew Pinski 2006-03-09 18:43:30 UTC
Confirmed, reduced testcase:
int t;

void search()
{
#pragma omp parallel for
 for (int i = 0; i < 1000; ++i) try {
   mm::print(t);
 }catch(...){}
}
Comment 5 Jakub Jelinek 2006-03-23 19:54:07 UTC
This is actually ICE on valid, a small modification of the testcase
that makes it valid still ICEs.
Comment 6 Jakub Jelinek 2006-03-24 16:14:47 UTC
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

Comment 7 Jakub Jelinek 2006-03-27 16:12:58 UTC
Fixed in SVN.