On Linux/x86-64, libstdc++ failed to compile at -O0: [hjl@gnu-6 gcc-work]$ /export/build/gnu/gcc-work/build-x86_64-linux/./gcc/xgcc -shared-libgcc -B/export/build/gnu/gcc-work/build-x86_64-linux/./gcc -nostdinc++ -L/export/build/gnu/gcc-work/build-x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/src -L/export/build/gnu/gcc-work/build-x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/src/.libs -B/usr/gcc-4.4-work/x86_64-unknown-linux-gnu/bin/ -B/usr/gcc-4.4-work/x86_64-unknown-linux-gnu/lib/ -isystem /usr/gcc-4.4-work/x86_64-unknown-linux-gnu/include -isystem /usr/gcc-4.4-work/x86_64-unknown-linux-gnu/sys-include -I/export/build/gnu/gcc-work/build-x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/include/x86_64-unknown-linux-gnu -I/export/build/gnu/gcc-work/build-x86_64-linux/x86_64-unknown-linux-gnu/libstdc++-v3/include -I/export/gnu/src/gcc-work/gcc/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -g -O0 -D_GNU_SOURCE -c /export/gnu/src/gcc-work/gcc/libstdc++-v3/src/compatibility.cc -fPIC -DPIC -o .libs/compatibility.o /export/gnu/src/gcc-work/gcc/libstdc++-v3/src/compatibility.cc:408: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. [hjl@gnu-6 gcc-work]$ Program received signal SIGSEGV, Segmentation fault. 0x00000000004ed628 in ggc_free (p=<value optimized out>) at ../../src-trunk/gcc/ggc-page.c:1421 1421 pe->in_use_p[word] &= ~(1UL << bit); Missing separate debuginfos, use: debuginfo-install glibc.x86_64 gmp.x86_64 mpfr.x86_64 (gdb) bt #0 0x00000000004ed628 in ggc_free (p=<value optimized out>) at ../../src-trunk/gcc/ggc-page.c:1421 #1 0x00000000005233c1 in flow_loops_free (loops=0xff0620) at ../../src-trunk/gcc/cfgloop.c:217 #2 0x0000000000a1d2eb in rest_of_handle_ira () at ../../src-trunk/gcc/ira.c:1885 #3 0x00000000006374d8 in execute_one_pass (pass=0xf672a0) at ../../src-trunk/gcc/passes.c:1279 #4 0x0000000000637705 in execute_pass_list (pass=0xf672a0) at ../../src-trunk/gcc/passes.c:1327 #5 0x000000000063771d in execute_pass_list (pass=0xf625c0) at ../../src-trunk/gcc/passes.c:1328 #6 0x0000000000707487 in tree_rest_of_compilation (fndecl=0x7f3e946e2300) at ../../src-trunk/gcc/tree-optimize.c:418 #7 0x0000000000826554 in cgraph_expand_function (node=0x7f3e942d0700) at ../../src-trunk/gcc/cgraphunit.c:1038 #8 0x0000000000826764 in cgraph_output_in_order () at ../../src-trunk/gcc/cgraphunit.c:1186 #9 0x0000000000827cfd in cgraph_optimize () at ../../src-trunk/gcc/cgraphunit.c:1297 #10 0x0000000000451d6d in cp_write_global_declarations () at ../../src-trunk/gcc/cp/decl2.c:3608 #11 0x00000000006cce81 in toplev_main (argc=<value optimized out>, ---Type <return> to continue, or q <return> to quit--- argv=<value optimized out>) at ../../src-trunk/gcc/toplev.c:979 #12 0x000000342da1e32a in __libc_start_main () from /lib64/libc.so.6 #13 0x0000000000404369 in _start () (gdb)
It is caused by revision 140285.
(In reply to comment #1) > It is caused by revision 140285. That does not mean there is a bug in IRA. Can you attach the preprocessed source?
Created attachment 16308 [details] A testcase [hjl@gnu-6 gcc]$ ./xgcc -B./ -S /tmp/x.ii /export/gnu/src/gcc-work/gcc/libstdc++-v3/src/compatibility.cc:202: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. [hjl@gnu-6 gcc]$
g++.dg/cpp0x/variadic-tuple.C fails for me with an ICE during GC.
Here is a reduced testcase for the variadic-tuple.C failure. Compile with --param ggc-min-expand=0 --param ggc-min-heapsize=0 -w: namespace std __attribute__ ((__visibility__ ("default"))) { template<typename _CharT> class basic_string; typedef basic_string<char> string; template<typename _CharT> struct basic_string { void _M_destroy() throw(); basic_string(const char* __s); ~basic_string() { _M_destroy(); } }; template<typename _CharT> void basic_string<_CharT>:: _M_destroy() throw () { } extern template class basic_string<char>; }; template<typename... Values> class tuple; template<> class tuple<> { }; template<typename Head, typename... Tail> struct tuple<Head, Tail...> : private tuple<Tail...> { typedef tuple<Tail...> inherited; tuple() { } template<typename... VValues> tuple(const tuple<VValues...>& other) : m_head(other.head()) ,inherited(other.tail()) { } const Head &head() const { } const inherited& tail() const { } Head m_head; }; int main() { tuple<int, float, const char*> t3a; tuple<long, double, std::string> t3b(t3a); }
Subject: Bug 37500 Author: hubicka Date: Sat Sep 13 07:30:15 2008 New Revision: 140334 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=140334 Log: PR middle-end/37500 * pt.c (tsubst_decl): Do not copy DECL_STRUCT_FUNCTION pointer. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c
Fixed by my patch.
*** Bug 37511 has been marked as a duplicate of this bug. ***