[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #11 from rguenth at gcc dot gnu dot org 2010-05-24 17:42 --- Subject: Bug 44196 Author: rguenth Date: Mon May 24 17:41:47 2010 New Revision: 159789 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159789 Log: 2010-05-24 Richard Guenther rguent...@suse.de PR lto/44196 * tree.c (find_decls_types_r): Walk BLOCKs and its vars. * g++.dg/lto/20100519-1_0.C: New testcase. Added: branches/gcc-4_5-branch/gcc/testsuite/g++.dg/lto/20100519-1_0.C Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/testsuite/ChangeLog branches/gcc-4_5-branch/gcc/tree.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #12 from rguenth at gcc dot gnu dot org 2010-05-24 17:52 --- Fixed. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Known to work|4.6.0 |4.5.1 4.6.0 Resolution||FIXED Target Milestone|--- |4.5.1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #2 from rguenth at gcc dot gnu dot org 2010-05-19 13:59 --- Confirmed. Reducing. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Keywords||lto Last reconfirmed|-00-00 00:00:00 |2010-05-19 13:59:35 date|| Summary|lto1: internal compiler |lto1: ICE: tree check: |error: Segmentation fault |expected field_decl, have ||type_decl in ||gimple_types_compatible_p, ||at gimple.c:3597 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #3 from rguenth at gcc dot gnu dot org 2010-05-19 14:10 --- template typename Ordinal struct DirectSerializationTraits { static void fromCountToDirectBytes(const Ordinal count) {} }; templatetypename Ordinal class SerializationTraits : public DirectSerializationTraitsOrdinal { }; template typename Ordinal class ConstValueTypeSerializationBuffer { public: ConstValueTypeSerializationBuffer(const Ordinal count) { typedef SerializationTraitsOrdinal SerT; SerT::fromCountToDirectBytes(count); } }; int main () { ConstValueTypeSerializationBufferint charSendBuffer(1); } -- rguenth at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Last reconfirmed|2010-05-19 13:59:35 |2010-05-19 14:10:32 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #4 from rguenth at gcc dot gnu dot org 2010-05-19 14:40 --- Hm, we still have TYPE_DECLs in TYPE_FIELDs somehow. I have a patch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #5 from rguenth at gcc dot gnu dot org 2010-05-19 15:01 --- Hm, we have a cgraph node ConstValueTypeSerializationBufferOrdinal::ConstValueTypeSerializationBuffer(Ordinal) [with Ordinal = int]/2(1) @0x77edd930 (asm: _ZN33ConstValueTypeSerializationBufferIiEC2Ei) analyzed 11 time, 12 benefit 2 size, 3 benefit reachable body finalized called by: int main()/0 (1.00 per call) (can throw external) calls: static void DirectSerializationTraitsOrdinal::fromCountToDirectBytes(Ordinal) [with Ordinal = int]/4 (1.00 per call) References: Refering this function: aliases thunks: ConstValueTypeSerializationBufferOrdinal::ConstValueTypeSerializationBuffer(Ordinal) [with Ordinal = int]/3 (asm: _ZN33ConstValueTypeSerializationBufferIiEC1Ei) where its function decl has DECL_SAVED_TREE, DECL_INITIAL and gimple_has_body_p is false. Huh. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added CC||hubicka at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #6 from rguenth at gcc dot gnu dot org 2010-05-19 15:08 --- I suppose this is an alias but we fail to clear its body/block tree. We end up refering to some TYPE_DECL in its BLOCK tree from somewhere else (but we don't stream that function decl in the end). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #7 from hubicka at ucw dot cz 2010-05-19 15:11 --- Subject: Re: lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597 I suppose this is an alias but we fail to clear its body/block tree. We end up refering to some TYPE_DECL in its BLOCK tree from somewhere else (but we don't stream that function decl in the end). For aliases we never clear their body/blocks because they are never finalized. If this is same_body_alias produced by C++ FE, I guess it should be responsible for giving us a decl alone. Overall C++ FE is leaking quite a few bodies/trees in unfinalized decls. I used to have aptch to clear them out but it was rejected for PCH reasons. Honza -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #8 from rguenther at suse dot de 2010-05-19 15:13 --- Subject: Re: lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597 On Wed, 19 May 2010, hubicka at ucw dot cz wrote: --- Comment #7 from hubicka at ucw dot cz 2010-05-19 15:11 --- Subject: Re: lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597 I suppose this is an alias but we fail to clear its body/block tree. We end up refering to some TYPE_DECL in its BLOCK tree from somewhere else (but we don't stream that function decl in the end). For aliases we never clear their body/blocks because they are never finalized. If this is same_body_alias produced by C++ FE, I guess it should be responsible for giving us a decl alone. Overall C++ FE is leaking quite a few bodies/trees in unfinalized decls. I used to have aptch to clear them out but it was rejected for PCH reasons. Ok, so my patch might be even correct as we are reaching the odd TYPE_DECL via streaming block abstract origin from a different function. Richard. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #9 from rguenth at gcc dot gnu dot org 2010-05-19 15:57 --- Subject: Bug 44196 Author: rguenth Date: Wed May 19 15:57:17 2010 New Revision: 159582 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=159582 Log: 2010-05-19 Richard Guenther rguent...@suse.de PR lto/44196 * tree.c (find_decls_types_r): Walk BLOCKs and its vars. * g++.dg/lto/20100519-1_0.C: New testcase. Added: trunk/gcc/testsuite/g++.dg/lto/20100519-1_0.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196
[Bug lto/44196] lto1: ICE: tree check: expected field_decl, have type_decl in gimple_types_compatible_p, at gimple.c:3597
--- Comment #10 from rguenth at gcc dot gnu dot org 2010-05-19 15:58 --- Fixed for 4.6. Leaving open for eventual backport for 4.5.1. -- rguenth at gcc dot gnu dot org changed: What|Removed |Added Known to fail||4.5.0 Known to work||4.6.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44196