Bug 31769 - ICE with OpenMP and exceptions
Summary: ICE with OpenMP and exceptions
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code, openmp
Depends on:
Blocks:
 
Reported: 2007-05-01 00:01 UTC by Mario Emmenlauer
Modified: 2007-05-30 14:00 UTC (History)
1 user (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-05-22 15:30:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Emmenlauer 2007-05-01 00:01:11 UTC
Hi,

The following small program gives ICE when compiled like this:

g++ -Wall -fopenmp -O2 -I$POLDEST/ext/include -E -o./test_pp.cc ./test.cc
g++ -Wall -fopenmp -O2 -L$POLDEST/ext/lib -o./test ./test_pp.cc -lblitz -lgomp
./test.cc: In function ‘int main()’:
./test.cc:3: internal compiler error: Segmentation fault

When removing the 'try-catch'-part it works fine.

----
#include <blitz/array.h>

int main()
{
  try
  {
    blitz::Array<float,1> transOrig( 10);
    blitz::Array<float,1> trans( 10);
    blitz::Range myRange( 0, 9);

#pragma omp parallel for
    for( int i = 0; i < 2; ++i)
    {
      trans += transOrig( myRange);
    }
  }
  catch( std::exception)
  {}
}

Here the preprocessed source: http://data.marssoft.de/attachment-bug-gcc.bz2
And my specs: ~> gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: [...]/gcc-4.2-branch/configure -v --enable-languages=c,c++,f95 --prefix=[...]/extgcc-x86_64_gcc4-r124295 --enable-shared --with-system-zlib --without-included-gettext --enable-threads=posix --enable-nls --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-debug --enable-gtk-cairo --with-mpfr=[...]/extgcc-x86_64_gcc4-r124295 --with-gmp=[...]/extgcc-x86_64_gcc4-r124295 --disable-werror --enable-checking=release --disable-multilib --enable-bootstrap
Thread model: posix
gcc version 4.2.0 20070430 (prerelease)
Comment 1 Mario Emmenlauer 2007-05-15 14:09:34 UTC
I can confirm the bug for i486-unknown-linux-gnu, too.
Comment 2 Jakub Jelinek 2007-05-22 15:30:46 UTC
Testing a patch.
Comment 3 Jakub Jelinek 2007-05-30 13:46:36 UTC
Subject: Bug 31769

Author: jakub
Date: Wed May 30 13:46:25 2007
New Revision: 125183

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125183
Log:
	PR tree-optimization/31769
	* except.c (duplicate_eh_regions): Clear prev_try if
	ERT_MUST_NOT_THROW region is inside of ERT_TRY region.

	* g++.dg/gomp/pr31769.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/pr31769.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/except.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Jakub Jelinek 2007-05-30 13:49:17 UTC
Subject: Bug 31769

Author: jakub
Date: Wed May 30 13:49:06 2007
New Revision: 125185

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125185
Log:
	PR tree-optimization/31769
	* except.c (duplicate_eh_regions): Clear prev_try if
	ERT_MUST_NOT_THROW region is inside of ERT_TRY region.

	* g++.dg/gomp/pr31769.C: New test.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/gomp/pr31769.C
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/except.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog

Comment 5 Jakub Jelinek 2007-05-30 14:00:52 UTC
Fixed on the trunk, gcc-4_2-branch and redhat/gcc-4_1-branch.