Bug 33361 - ICE in find_outermost_region_in_block, at tree-cfg.c:4803
Summary: ICE in find_outermost_region_in_block, at tree-cfg.c:4803
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.2.2
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code, monitored, openmp
: 33981 (view as bug list)
Depends on:
Blocks: 33981
  Show dependency treegraph
 
Reported: 2007-09-09 00:13 UTC by Andreas Beckmann
Modified: 2008-12-29 02:32 UTC (History)
6 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build:
Known to work: 4.3.0
Known to fail: 4.2.0 4.2.1 4.2.2
Last reconfirmed: 2007-09-09 14:24:50


Attachments
testcase (reduced to be < 500k) (57.96 KB, text/plain)
2007-09-09 12:51 UTC, Andreas Beckmann
Details
reduced testcase (3.74 KB, text/plain)
2007-09-09 14:24 UTC, Richard Biener
Details
minimal testcase (175 bytes, text/plain)
2007-09-17 17:35 UTC, Andreas Beckmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Beckmann 2007-09-09 00:13:16 UTC
Hi,

I'm getting an
    internal compiler error: in find_outermost_region_in_block, at 
    tree-cfg.c:4803
in -fopenmp mode with g++ 4.2.[012]. g++ 4.3 produces no error.

Andreas

$ /suse/NOBACKUP/gcc/gcc-4.2-branch/bin/g++ -v -save-temps -march=i686 -DSORT_OPTIMAL_PREFETCHING -DUSE_MALLOC_LOCK -DCOUNT_WAIT_TIME -I/home/andreas/work/uka/stxxl/parpipe/include -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE   -O3   -W -Wall -fopenmp -D__MCSTL__  -I/home/andreas/work/uka/mcstl/libstdc++/c++ -c ICE_find_outermost_region_in_block.cpp
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4_2-branch/configure --enable-languages=c,c++ --prefix=/suse/NOBACKUP/gcc/gcc-4.2-branch
Thread model: posix
gcc version 4.2.2 20070908 (prerelease)
 /suse/NOBACKUP/gcc/gcc-4.2-branch/libexec/gcc/i686-pc-linux-gnu/4.2.2/cc1plus -E -quiet -v -I/home/andreas/work/uka/stxxl/parpipe/include -I/home/andreas/work/uka/mcstl/libstdc++/c++ -D_GNU_SOURCE -D_REENTRANT -DSORT_OPTIMAL_PREFETCHING -DUSE_MALLOC_LOCK -DCOUNT_WAIT_TIME -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D__MCSTL__ ICE_find_outermost_region_in_block.cpp -march=i686 -W -Wall -fopenmp -O3 -fpch-preprocess -o ICE_find_outermost_region_in_block.ii
ignoring nonexistent directory "/suse/NOBACKUP/gcc/gcc-4.2-branch/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/andreas/work/uka/stxxl/parpipe/include
 /home/andreas/work/uka/mcstl/libstdc++/c++
 /suse/NOBACKUP/gcc/gcc-4.2-branch/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../../include/c++/4.2.2
 /suse/NOBACKUP/gcc/gcc-4.2-branch/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../../include/c++/4.2.2/i686-pc-linux-gnu
 /suse/NOBACKUP/gcc/gcc-4.2-branch/lib/gcc/i686-pc-linux-gnu/4.2.2/../../../../include/c++/4.2.2/backward
 /usr/local/include
 /suse/NOBACKUP/gcc/gcc-4.2-branch/include
 /suse/NOBACKUP/gcc/gcc-4.2-branch/lib/gcc/i686-pc-linux-gnu/4.2.2/include
 /usr/include
End of search list.
 /suse/NOBACKUP/gcc/gcc-4.2-branch/libexec/gcc/i686-pc-linux-gnu/4.2.2/cc1plus -fpreprocessed ICE_find_outermost_region_in_block.ii -quiet -dumpbase ICE_find_outermost_region_in_block.cpp -march=i686 -auxbase ICE_find_outermost_region_in_block -O3 -W -Wall -version -fopenmp -o ICE_find_outermost_region_in_block.s
GNU C++ version 4.2.2 20070908 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.2 20070908 (prerelease).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 7993b3af5142d87e347d8f7153b00978
/home/andreas/work/uka/mcstl/libstdc++/c++/bits/mcstl_par_loop.h: In function ‘Op mcstl::for_each_template_random_access_ed(RandomAccessIterator, RandomAccessIterator, Op, Fu&, Red, Result, Result&, typename std::iterator_traits<_Iterator>::difference_type) [with RandomAccessIterator = stxxl::request_ptr*, Op = stxxl::request_ptr, Fu = mcstl::fill_selector<stxxl::request_ptr*>, Red = mcstl::dummy_reduct, Result = bool]’:
/home/andreas/work/uka/mcstl/libstdc++/c++/bits/mcstl_par_loop.h:45: internal compiler error: in find_outermost_region_in_block, at tree-cfg.c:4803
Comment 1 Andreas Beckmann 2007-09-09 12:51:58 UTC
Created attachment 14177 [details]
testcase (reduced to be < 500k)

Sorry for the delay of the testcase, I had to reduce it from 1.9 MB to 440 KB.
(Is there some helper script that can do this in a more or less brute force way?
Strip complete namespaces, classes, member functions, ... from the code, recompile and check for a certain error message? Continue it it's still there and backtrack otherwise?)

$ /suse/NOBACKUP/gcc/gcc-4.2-branch/bin/g++ -v  -march=i686 -O3 -fopenmp -c PR33361.ii
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4_2-branch/configure --enable-languages=c,c++ --prefix=/suse/NOBACKUP/gcc/gcc-4.2-branch
Thread model: posix
gcc version 4.2.2 20070908 (prerelease)
 /suse/NOBACKUP/gcc/gcc-4.2-branch/libexec/gcc/i686-pc-linux-gnu/4.2.2/cc1plus -fpreprocessed PR33361.ii -quiet -dumpbase PR33361.ii -march=i686 -auxbase PR33361 -O3 -version -fopenmp -o /tmp/ccslyrRU.s
GNU C++ version 4.2.2 20070908 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.2 20070908 (prerelease).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 7993b3af5142d87e347d8f7153b00978
PR33361.ii: In function ‘Op mcstl::for_each_template_random_access_ed(RandomAccessIterator, RandomAccessIterator, Op, Fu&, Red, Result, Result&, typename std::iterator_traits<_Iterator>::difference_type) [with RandomAccessIterator = stxxl::request_ptr*, Op = stxxl::request_ptr, Fu = mcstl::fill_selector<stxxl::request_ptr*>, Red = mcstl::dummy_reduct, Result = bool]’:
PR33361.ii:3047: internal compiler error: in find_outermost_region_in_block, at tree-cfg.c:4803
Comment 2 Richard Biener 2007-09-09 13:37:42 UTC
Reducing.
Comment 4 Richard Biener 2007-09-09 14:24:22 UTC
Created attachment 14178 [details]
reduced testcase
Comment 5 Richard Biener 2007-09-09 14:24:50 UTC
Confirmed.
Comment 6 Andreas Beckmann 2007-09-17 17:35:49 UTC
Created attachment 14216 [details]
minimal testcase

The ICE only occurs with -O3 and above.

$ /suse/NOBACKUP/gcc/gcc-4.2-branch/bin/g++ -v -O3 -fopenmp -c PR33361.min.ii
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4_2-branch/configure --enable-languages=c,c++ --prefix=/suse/NOBACKUP/gcc/gcc-4.2-branch
Thread model: posix
gcc version 4.2.2 20070910 (prerelease)
 /suse/NOBACKUP/gcc/gcc-4.2-branch/libexec/gcc/i686-pc-linux-gnu/4.2.2/cc1plus -fpreprocessed PR33361.min.ii -quiet -dumpbase PR33361.min.ii -mtune=generic -auxbase PR33361.min -O3 -version -fopenmp -o /tmp/ccdvfpMn.s
GNU C++ version 4.2.2 20070910 (prerelease) (i686-pc-linux-gnu)
        compiled by GNU C version 4.2.2 20070908 (prerelease).
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 4c766e638e42be49e7fc1a3400590598
PR33361.min.ii: In function ‘void f()’:
PR33361.min.ii:25: internal compiler error: in find_outermost_region_in_block, at tree-cfg.c:4803
Comment 7 Volker Reichelt 2007-12-27 16:03:47 UTC
Shorter testcase that crashes already with "-O -fopenmp":

======================================
void foo();

struct A
{
  A() throw() { foo(); }
};

void bar()
{
#pragma omp parallel
  A a, b;
}
======================================
Comment 8 Jakub Jelinek 2008-03-10 10:29:08 UTC
No plans to backport this to 4.2.
Comment 9 Volker Reichelt 2008-12-29 02:32:39 UTC
*** Bug 33981 has been marked as a duplicate of this bug. ***