This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] PR 12389

On Sun, 19 Oct 2003 14:52:17 +0200, Jan Hubicka <> wrote:

>> On Sun, Oct 19, 2003 at 10:00:39AM +0200, Jan Hubicka wrote:
>> > Also what about COOMDAT functions?  I guess the debug info should be
>> > conservative then and always claim that function has been inlined as it
>> > may be inlined in the other compilation unit, right?
>> What I understand from the DWARF2 specs is that the definitions
>> of the DW_AT_inline attribute
>>   DW_INL_declared_inlined	Declared inline and inlined by the compiler
>>   DW_INL_inlined	 	Not declared inline but inlined by the compiler
>>   DW_INL_declared_not_inlined	Declared inline but not inlined by the compiler
>>   DW_INL_not_inlined		Not declared inline nor inlined by the compiler
> Good.  My current patch should get this accurate for -funit-at-a-time
> and conservative for -fno-unit-at-a-time in a way that
> DW_INL_declared_inlined and DW_INL_inlined may be emit for inlinable
> functions that are never really inlined .  I hope this is not big deal.
> We never use DW_INL_not_inline and simply produce no DW_AT_inline
> attribute then.  So hope that not_inline is the default.

not_inline is the default, but unlike most dwarf2 attributes, the very
presence or absence of DW_AT_inline has meaning.  Iff there is a
DW_AT_inline attribute, the DIE is for an abstract instance.  Thus, iff
we're generating info for a DECL_ABSTRACT function, we must add a
DW_AT_inline attribute.

The actual value of the attribute has no real use.  I suppose a debugger
might use it to decide whether or not to do an expensive search for inlined
copies of a function, but whether or not a function is actually declared
inline is just extra information.

>> really means this *)
>>   DW_INL_declared_inlined	same
>>   DW_INL_inlined	 	same
>>   DW_INL_declared_not_inlined	Declared inline but no other DIE refers to this
>>   				entry as its abstract origin.

No; the out-of-line concrete instance still refers to this as its abstract origin.

>>   DW_INL_not_inlined		Not declared inline and no other DIE refers to
>>   				this entry as its abstract origin.

Ditto.  Though we shouldn't ever generate this.

>> And since these references (DW_AT_abstract_origin) are per compilation
>> unit (DW_TAG_compile_unit), the answer seems to be no.

This premise is invalid.  All DIE references can cross compilation units
using DW_FORM_ref_addr.  -feliminate-dwarf2-dups uses that to refer to
common debug info from multiple translation units.  Unfortunately, gdb
still doesn't support this, which is why -feliminate-dwarf2-dups has never
been made the default.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]