GCC Bugzilla – Bug 28217
[4.0 regression] ICE in tree_int_cst_sgn
Last modified: 2007-02-03 17:49:44 UTC
/tmp/cvs/gcc-20060701/Build/./gcc/xgcc -shared-libgcc -B/tmp/cvs/gcc-20060701/Build/./gcc -nostdinc++ -L/tmp/cvs/gcc-20060701/Build/ia64-suse-linux/libstdc++-v3/src -L/tmp/cvs/gcc-20060701/Build/ia64-suse-linux/libstdc++-v3/src/.libs -B/tmp/cvs/gcc-20060701/Build/root/ia64-suse-linux/bin/ -B/tmp/cvs/gcc-20060701/Build/root/ia64-suse-linux/lib/ -isystem /tmp/cvs/gcc-20060701/Build/root/ia64-suse-linux/include -isystem /tmp/cvs/gcc-20060701/Build/root/ia64-suse-linux/sys-include -Winvalid-pch -Wno-deprecated -xc++-header -O2 -g -D_GNU_SOURCE -I/tmp/cvs/gcc-20060701/Build/ia64-suse-linux/libstdc++-v3/include/ia64-suse-linux -I/tmp/cvs/gcc-20060701/Build/ia64-suse-linux/libstdc++-v3/include -I/tmp/cvs/gcc-20060701/libstdc++-v3/libsupc++ /tmp/cvs/gcc-20060701/libstdc++-v3/include/precompiled/extc++.h -O2 -g -o ./ia64-suse-linux/bits/extc++.h.gch/O2g.gch /tmp/cvs/gcc-20060701/Build/ia64-suse-linux/libstdc++-v3/include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp:235: internal compiler error: tree check: expected integer_cst, have scope_ref in tree_int_cst_sgn, at tree.c:4476 #1 0x40000000008cd430 in tree_check_failed (node=0x200000000189da40, file=0x4000000000d013b8 "../../gcc/tree.c", line=4476, function=0x4000000000d03d98 "tree_int_cst_sgn") at ../../gcc/tree.c:6059 6059 internal_error ("tree check: %s, have %s in %s, at %s:%d", (gdb) up #2 0x40000000008cf5b0 in tree_int_cst_sgn (t=0x200000000189da40) at ../../gcc/tree.c:4476 4476 if (TREE_INT_CST_LOW (t) == 0 && TREE_INT_CST_HIGH (t) == 0) (gdb) p t $1 = (tree) 0x200000000189da40 (gdb) pt t <scope_ref 0x200000000189da40 arg 0 <record_type 0x2000000001f9a050 is_simple<Key> type_0 type_5 type_6 VOID align 8 symtab 0 alias set -1 context <namespace_decl 0x2000000001dd1ad0 detail> no-binfo use_template=1 interface-unknown chain <type_decl 0x2000000001f9f5a0 is_simple<Key>>> arg 1 <identifier_node 0x200000010615bbc0 value bindings <(nil)> local bindings <(nil)>>> (gdb) up During symbol reading, unsupported tag: 'DW_TAG_const_type'. #3 0x4000000000235010 in write_template_arg_literal ( value=<value optimized out>) at ../../gcc/cp/mangle.c:1216 1216 int sign = tree_int_cst_sgn (cst); (gdb) up #4 0x4000000000237da0 in write_template_args (args=0x2000000002aa6e40) at ../../gcc/cp/mangle.c:2310 2310 write_template_arg_literal (node); (gdb) p args $2 = (tree) 0x2000000002aa6e40 (gdb) pt <tree_vec 0x2000000002aa6e40 elt 0 <const_decl 0x2000000001cba260 simple_value> elt 1 <template_type_parm 0x200000000189b180 Value_Type> elt 2 <typename_type 0x2000000001846730 pointer>> (gdb) p *mangle_obstack $10 = {chunk_size = 4064, chunk = 0x6000000000219dc0, object_base = 0x600000000021a2be "_ZN5pb_ds6detail12binary_heap_IT_T0_T1_E6modifyENS0_33binary_heap_const_point_iterator_IS2_NS0_16conditional_typeILNS5_5._199E", next_free = 0x600000000021a33c "", chunk_limit = 0x600000000021ada0 "", temp = 0, alignment_mask = 0, chunkfun = @0x4000000000d84880: 0x4000000000c38e00 <xmalloc>, freefun = 0x2000000000046798 <local+4696>, extra_arg = 0x0, use_extra_arg = 0, maybe_empty_object = 0, alloc_failed = 0}
*** Bug 28219 has been marked as a duplicate of this bug. ***
Testcase? Works for me...
I want to say this was fixed by: http://gcc.gnu.org/ml/gcc-cvs/2006-07/msg00011.html And this works for me also.
Still crashes as of today.
Subject: Re: [4.2 regression] ICE in tree_int_cst_sgn On Tuesday 04 July 2006 10:39, rguenth at gcc dot gnu dot org wrote: > Testcase? Works for me... 28219 has a testcase -Fred
(In reply to comment #5) > 28219 has a testcase It does not have a full testcase as you also need the other PCH header file to try it out.
*** Bug 28290 has been marked as a duplicate of this bug. ***
This is now causing bootstrap to fail.
Subject: Re: [4.2 regression] ICE in tree_int_cst_sgn On Tuesday 11 July 2006 04:44, schwab at suse dot de wrote: > This is now causing bootstrap to fail. I'm currently configuring with --disable-libstdcxx-pch to work around the problem.
This now causes bootstrap failure on primary platforms.
I've posted a patch to fix this.
Reduced (from PR 28219) testcase: ============================= template<int> struct A { enum { a, b = a }; void foo(A<b>); }; ============================= bug.h:4: internal compiler error: tree check: expected integer_cst, have const_decl in tree_int_cst_sgn, at tree.c:4517 Please submit a full bug report, [etc.] If I replace "A<b>" by "A<a>" I get a segfault instead. The testcase crashes since GCC 4.0.0. The code compiles fine if I compile it as regular C++ file and not as C++-header.
Volker, great job on the reduction for this. I am once again amazed. -benjamin
Subject: Bug 28217 Author: jason Date: Wed Jul 12 21:57:58 2006 New Revision: 115399 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115399 Log: PR c++/28217 * semantics.c (note_decl_for_pch): Don't premangle templates. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/semantics.c
Fixed on the mainline at least.
Jason, would you mind adding a testcase? Thanks!
Subject: Bug 28217 Author: jakub Date: Wed Jan 3 23:53:18 2007 New Revision: 120410 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120410 Log: PR c++/28217 * g++.dg/pch/template-1.C: New test. * g++.dg/pch/template-1.Hs: New file. Added: trunk/gcc/testsuite/g++.dg/pch/template-1.C trunk/gcc/testsuite/g++.dg/pch/template-1.Hs Modified: trunk/gcc/testsuite/ChangeLog
Subject: Bug 28217 Author: jakub Date: Wed Jan 3 23:54:24 2007 New Revision: 120411 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120411 Log: PR c++/28217 * g++.dg/pch/template-1.C: New test. * g++.dg/pch/template-1.Hs: New file. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/pch/template-1.C branches/gcc-4_2-branch/gcc/testsuite/g++.dg/pch/template-1.Hs Modified: branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
Subject: Bug 28217 Author: jakub Date: Wed Jan 3 23:56:44 2007 New Revision: 120412 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=120412 Log: Backported from mainline 2006-07-12 Jason Merrill <jason@redhat.com> PR c++/28217 * semantics.c (note_decl_for_pch): Don't premangle templates. * g++.dg/pch/template-1.C: New test. * g++.dg/pch/template-1.Hs: New file. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/pch/template-1.C branches/gcc-4_1-branch/gcc/testsuite/g++.dg/pch/template-1.Hs Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/semantics.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed in 4.1 as well.
Fixed in GCC-4.1.2