Bug 30494 - ICE with VLA and openmp
Summary: ICE with VLA and openmp
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://bigapple.uky.edu/~brandon/prep...
Keywords: openmp
Depends on:
Blocks:
 
Reported: 2007-01-18 03:52 UTC by Brandon Barker
Modified: 2007-01-26 23:45 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-01-23 14:18:56


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brandon Barker 2007-01-18 03:52:17 UTC
Compiler output:

g++ -save-temps -Wall -g -fopenmp -Wno-deprecated -O4 -ffast-math -fexpensive-optimizations -DLINUX -I/home/latte/paraLattE/NTL/include  -I/usr/local/gcc4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/include -c BirkhoffCones.cpp
BirkhoffCones.cpp: In function ‘int Birkhoff_with_Vol_para(int, int, int, int, int, int)’:
BirkhoffCones.cpp:2462: internal compiler error: in gimplify_expr, at gimplify.c:5979
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
make: *** [BirkhoffCones.o] Error 1
Comment 1 Andrew Pinski 2007-01-18 10:13:33 UTC
Confirmed, reduced testcase (I thought I had asked about this interaction before):
int Birkhoff_with_Vol_para(int n)
{
  int I;
#pragma omp for
	for(I = 0; I < 6; I++) 
	{
		int v[n];
	}
}

--------
This ICEs for both the C and C++ front-ends.  Considering VLA is C99, we should support this.  Also I bet you can produce a fortran code which also ICEs.
Comment 2 Jakub Jelinek 2007-01-24 20:57:09 UTC
Subject: Bug 30494

Author: jakub
Date: Wed Jan 24 20:56:45 2007
New Revision: 121132

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121132
Log:
	PR middle-end/30494
	* gimplify.c (omp_add_variable): Don't call omp_notice_variable
	on TYPE_SIZE_UNIT for GOVD_LOCAL VLAs.

	* gcc.dg/gomp/pr30494.c: New test.
	* g++.dg/gomp/pr30494.C: New test.

	* testsuite/libgomp.c/pr30494.c: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/pr30494.C
    trunk/gcc/testsuite/gcc.dg/gomp/pr30494.c
    trunk/libgomp/testsuite/libgomp.c/pr30494.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/testsuite/ChangeLog
    trunk/libgomp/ChangeLog

Comment 3 Jakub Jelinek 2007-01-24 21:04:18 UTC
Subject: Bug 30494

Author: jakub
Date: Wed Jan 24 21:03:31 2007
New Revision: 121135

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121135
Log:
	PR middle-end/30494
	* gimplify.c (omp_add_variable): Don't call omp_notice_variable
	on TYPE_SIZE_UNIT for GOVD_LOCAL VLAs.

	* gcc.dg/gomp/pr30494.c: New test.
	* g++.dg/gomp/pr30494.C: New test.

	* testsuite/libgomp.c/pr30494.c: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/gomp/pr30494.C
    branches/gcc-4_2-branch/gcc/testsuite/gcc.dg/gomp/pr30494.c
    branches/gcc-4_2-branch/libgomp/testsuite/libgomp.c/pr30494.c
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/gimplify.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/libgomp/ChangeLog

Comment 4 Jakub Jelinek 2007-01-26 23:45:44 UTC
Fixed in SVN.