http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45854
Summary: ICE in redirect_eh_edge_1, at tree-eh.c:2131
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: [email protected]
ReportedBy: [email protected]
The following code fails in 4.5.2 (but not 4.4.5, 4.3.6 or 4.6.0) in
optimization levels -O2 and -O3:
========== 8< ==========
template < typename = void >
struct X { } ;
struct Y
{
Y () ;
} ;
template < typename = X < > >
struct T
{
void f ()
{
f () ;
}
} ;
struct S
{
S ( X < > = X < > ()) ;
~S ()
{
T < > () . f () ;
}
} ;
struct
{
S s ;
Y y ;
} a ;
========== >8 ==========
which this error:
_.cpp:28:3: warning: non-local variable ‘<anonymous struct> a’ uses anonymous
type
_.cpp: In constructor ‘<anonymous struct>::._0()’:
_.cpp:28:5: internal compiler error: in redirect_eh_edge_1, at tree-eh.c:2131
$ g++-4.5.x -v -O2 -c ice-redirect_eh_edge_1-tree-eh-c-2131.min.cpp
Using built-in specs.
COLLECT_GCC=/opt/software/x86_64/gcc-4.5.x/bin/g++-4.5.x
COLLECT_LTO_WRAPPER=/opt/software/x86_64/gcc-4.5.x/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4_5-branch/configure
--prefix=/opt/software/x86_64/gcc-4.5.x --program-suffix=-4.5.x
--enable-languages=c,c++ --enable-checking
Thread model: posix
gcc version 4.5.2 20100930 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-v' '-O2' '-c' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/opt/software/x86_64/gcc-4.5.x/libexec/gcc/x86_64-unknown-linux-gnu/4.5.2/cc1plus
-quiet -v -D_GNU_SOURCE ice-redirect_eh_edge_1-tree-eh-c-2131.min.cpp -quiet
-dumpbase ice-redirect_eh_edge_1-tree-eh-c-2131.min.cpp -mtune=generic
-march=x86-64 -auxbase ice-redirect_eh_edge_1-tree-eh-c-2131.min -O2 -version
-o /tmp/ccbGteU6.s
GNU C++ (GCC) version 4.5.2 20100930 (prerelease) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.2 20100930 (prerelease), GMP version
4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
ignoring nonexistent directory
"/opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2
/opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/x86_64-unknown-linux-gnu
/opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../include/c++/4.5.2/backward
/usr/local/include
/opt/software/x86_64/gcc-4.5.x/include
/opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/include
/opt/software/x86_64/gcc-4.5.x/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/include-fixed
/usr/include
End of search list.
GNU C++ (GCC) version 4.5.2 20100930 (prerelease) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.5.2 20100930 (prerelease), GMP version
4.3.2, MPFR version 3.0.0-p3, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 1be67b2d58ac92677e3812da572956df
ice-redirect_eh_edge_1-tree-eh-c-2131.min.cpp:28:3: warning: non-local variable
‘<anonymous struct> a’ uses anonymous type
ice-redirect_eh_edge_1-tree-eh-c-2131.min.cpp: In constructor ‘<anonymous
struct>::._0()’:
ice-redirect_eh_edge_1-tree-eh-c-2131.min.cpp:28:5: internal compiler error: in
redirect_eh_edge_1, at tree-eh.c:2131
Please submit a full bug report,