http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45894
Summary: ICE: segmentation fault with -Wall Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: g...@abeckmann.de I get an "internal compiler error: Segmentation fault" when compiling this code with 4.5.2/4.6.0 and -Wall. The problem disappears if I remove -Wall. 4.4.5 and 4.3.x report "error: statement cannot resolve address of overloaded function" ========== 8< =========== struct FOO { template < typename = void > void Bar () ; } ; template < typename = void > struct V { V ( const V &) { FOO :: Bar < > ; } } ; struct C { V < > v ; } ; struct B { C f () ; } ; struct A { C c ; B b ; A () : c ( b . f () ) { } } ; ========== >8 =========== $ g++-4.5.x -v -std=c++0x -Wall -c segfault-ice.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 20101004 (prerelease) (GCC) COLLECT_GCC_OPTIONS='-v' '-std=c++0x' '-Wall' '-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 segfault-ice.min.cpp -quiet -dumpbase segfault-ice.min.cpp -mtune=generic -march=x86-64 -auxbase segfault-ice.min -Wall -std=c++0x -version -o /tmp/cco6qHiQ.s GNU C++ (GCC) version 4.5.2 20101004 (prerelease) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.5.2 20101004 (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 20101004 (prerelease) (x86_64-unknown-linux-gnu) compiled by GNU C version 4.5.2 20101004 (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: 8c3e00fe3cfb9293e6e3b31a6f7f6d80 segfault-ice.min.cpp: In copy constructor ‘V< <template-parameter-1-1> >::V(const V< <template-parameter-1-1> >&)’: segfault-ice.min.cpp:11:18: warning: statement is a reference, not call, to function ‘FOO::Bar [with <template-parameter-1-1> = void]’ segfault-ice.min.cpp: In copy constructor ‘V< <template-parameter-1-1> >::V(const V< <template-parameter-1-1> >&) [with <template-parameter-1-1> = void, V< <template-parameter-1-1> > = V<>]’: segfault-ice.min.cpp:15:1: instantiated from here segfault-ice.min.cpp:11:3: internal compiler error: Segmentation fault Please submit a full bug report,