[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-17 Thread jakub at gcc dot gnu dot org


--- Comment #6 from jakub at gcc dot gnu dot org  2009-03-17 17:44 ---
Subject: Bug 39412

Author: jakub
Date: Tue Mar 17 17:43:52 2009
New Revision: 144909

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=144909
Log:
PR debug/39412
* dwarf2out.c (gen_inlined_enumeration_type_die,
gen_inlined_structure_type_die, gen_inlined_union_type_die,
gen_tagged_type_instantiation_die): Removed.
(gen_decl_die): For TYPE_DECL_IS_STUB with non-NULL decl_origin
do nothing.

* gcc.dg/debug/pr39412.c: New test.

Added:
trunk/gcc/testsuite/gcc.dg/debug/pr39412.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412



[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-12 Thread jakub at gcc dot gnu dot org


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
   |dot org |
 Status|NEW |ASSIGNED
   Last reconfirmed|2009-03-09 17:47:29 |2009-03-12 16:29:21
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412



[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-11 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

   Priority|P3  |P2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412



[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-10 Thread jakub at gcc dot gnu dot org


--- Comment #3 from jakub at gcc dot gnu dot org  2009-03-10 09:43 ---
What's the point in generating the DIE in gen_tagged_type_instantiation_die?
Seems we are generating that since like forever (that function existed already
when dwarf2out.c was added to the repository in 1996), but as it doesn't
equate_type_number_to_die, unless -fno-eliminate-unused-debug-types it is
always pruned anyway and even if it is not pruned, it is never used by
anything.
If there is an inline function which defines some type, variables of that type
will be typically emitted inside of the abstract DW_TAG_subprogram DIE and vars
elsewhere will just have DW_AT_abstract_origin pointing to those, not defining
the type at all.
Also, gen_tagged_type_instantiation_die types can be emitted many times.
Say:
struct S { int i; };

extern void baz (void *);

inline void
bar (void *x, unsigned long y)
{
  union { struct S a[y]; } *u = x;
  baz (u);
}

void
foo (void *x, unsigned long y)
{
  bar (x, y);
}

at -fno-eliminate-unused-debug-types -g -O2 -dA has 2:
.uleb128 0x12   # (DIE (0xda) DW_TAG_union_type)
.long   0x6b# DW_AT_abstract_origin
.uleb128 0x12   # (DIE (0xdf) DW_TAG_union_type)
.long   0x6b# DW_AT_abstract_origin
(both unused).  So before teaching gen_tagged_type_instantiation_die to handle
quals (add DW_TAG_const_type or DW_TAG_volatile_type around it), I'd like to
question if gen_tagged_type_instantiation_die shouldn't be nuked instead.


-- 

jakub at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||jason at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412



[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-10 Thread rguenth at gcc dot gnu dot org


--- Comment #4 from rguenth at gcc dot gnu dot org  2009-03-10 11:01 ---
Sounds reasonable.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412



[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-10 Thread jason at redhat dot com


--- Comment #5 from jason at redhat dot com  2009-03-10 16:41 ---
Subject: Re:  [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

jakub at gcc dot gnu dot org wrote:
 What's the point in generating the DIE in gen_tagged_type_instantiation_die?

It seems to be for generating the DIE to represent the type definition 
in a concrete instance of an inline function.  I don't know why it would 
be called multiple times, since it's only called when we process the 
stub TYPE_DECL; calling gen_decl_die multiple times for that seems 
surprising.

But as you say, there doesn't seem to be any point in emitting such a 
DIE at all, since the variables will already have a type in the abstract 
instance.

 I'd like to question if gen_tagged_type_instantiation_die shouldn't be nuked 
 instead.

Go ahead.

Jason


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412



[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-09 Thread hjl dot tools at gmail dot com


--- Comment #1 from hjl dot tools at gmail dot com  2009-03-09 20:52 ---
This is introduced by revision 117493:

http://gcc.gnu.org/ml/gcc-cvs/2006-10/msg00158.html
http://gcc.gnu.org/ml/gcc-patches/2006-10/msg00239.html


-- 

hjl dot tools at gmail dot com changed:

   What|Removed |Added

 CC||hainque at adacore dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412



[Bug debug/39412] [4.2/4.3/4.4 Regression] ICE in gen_tagged_type_instantiation_die

2009-03-09 Thread jakub at gcc dot gnu dot org


--- Comment #2 from jakub at gcc dot gnu dot org  2009-03-09 21:12 ---
Yeah, before r128631 (PR debug/33316) it ICEd in modified_type_die, after it in
gen_tagged_type_instantiation_die.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39412