Bug 36802 - [4.4 Regression] pop_gimplify_context ICE using openmp task construct
Summary: [4.4 Regression] pop_gimplify_context ICE using openmp task construct
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, openmp
Depends on:
Blocks:
 
Reported: 2008-07-11 03:14 UTC by Jonathan Blanchard
Modified: 2008-12-08 10:42 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.0
Known to fail: 4.4.0
Last reconfirmed: 2008-08-11 01:44:23


Attachments
preprocessed file of the presented testcase (229 bytes, text/plain)
2008-07-11 03:15 UTC, Jonathan Blanchard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Blanchard 2008-07-11 03:14:16 UTC
I get the following error when compiling using gcc snapshot 4.4.0 20080704

main.c|18|internal compiler error: in pop_gimplify_context, at gimplify.c:194

See code at the end of the post and gcc configure options.

Obviously when removing the -fopenmp switch the ICE go away. Also removing either the omp task or omp single directive make the error go away. The ICE also vanish if the expression inside the while loop is a constant.

This error appear at all optimization level with or without debugging enabled. 

using the following code (reduced case...) :

int main()
{
int i = 0;
#pragma omp parallel
{
    #pragma omp single
    while( i < 1 )
    {
        #pragma omp task
        i++;
    }
}
  return 0;
}

gcc configure options :
$ gcc -v
Using built-in specs.
Target: mingw32
Configured with: ./gcc-4.4.0/configure --prefix=/mingw --enable-bootstrap --build=mingw32 --program-prefix= --with-as=/mingw/bin/as.exe --with-ld=/mingw/bin/ld.exe --with-gcc --with-gnu-ld --with-gnu-as --enable-languages=c,c++,objc,fortran --disable-nls --disable-win32-registry --disable-werror --enable-sjlj-exceptions --enable-threads=win32 --disable-symvers --disable-libstdcxx-pch --enable-version-specific-runtime-libs --enable-cxx-flags='-fno-function-sections -fno-data-sections' --enable-fully-dynamic-string --enable-libgomp --enable-checking=release
Thread model: win32
gcc version 4.4.0 20080704 (experimental) (GCC)
Comment 1 Jonathan Blanchard 2008-07-11 03:15:53 UTC
Created attachment 15896 [details]
preprocessed file of the presented testcase
Comment 2 Andrew Pinski 2008-08-11 01:44:23 UTC
Confirmed, this worked in 4.3.0.
Comment 3 Jakub Jelinek 2008-12-08 10:37:26 UTC
Subject: Bug 36802

Author: jakub
Date: Mon Dec  8 10:36:01 2008
New Revision: 142546

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=142546
Log:
	PR middle-end/36802
	* omp-low.c (use_pointer_for_field): Only call maybe_lookup_decl
	on parallel and task contexts.

	* testsuite/libgomp.c/pr36802-1.c: New test.
	* testsuite/libgomp.c/pr36802-2.c: New test.
	* testsuite/libgomp.c/pr36802-3.c: New test.

Added:
    trunk/libgomp/testsuite/libgomp.c/pr36802-1.c
    trunk/libgomp/testsuite/libgomp.c/pr36802-2.c
    trunk/libgomp/testsuite/libgomp.c/pr36802-3.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/omp-low.c
    trunk/libgomp/ChangeLog

Comment 4 Jakub Jelinek 2008-12-08 10:42:01 UTC
Your testcase has data races, but I came up with valid testcases.