[RFC PATCH] Add __attribute__((__artificial__)) (__nodebug__ alternative)

Jakub Jelinek jakub@redhat.com
Sat Sep 8 13:24:00 GMT 2007

On Fri, Aug 31, 2007 at 02:06:10PM -0700, Roland McGrath wrote:
> The spec only mentions using DW_AT_artificial for types and objects, though
> using it in this way for subprogram et al seems natural to me (no pun
> intended).  But, it occurs to me that DW_AT_trampoline is another
> description that might make sense for this case.  That one has the benefit
> that its value can be something descriptive, a name or pointer to another
> DIE or address.  So it could indicate to the debugger/user not just "this
> is uninteresting", but "this is uninteresting and gets to the target of
> actual interest 'memcpy'".  Unless the feature is drastically, different
> that would just have to be explicit in __attribute__ in the source, i.e.
> __attribute__((__trampoline__ ("memcpy"))) or something.  

Unfortunately DW_AT_trampoline is usable just for a subset of the cases
I meant to use DW_AT_artificial for.
E.g. all uses in *mmintrin.h will be expanded inline:

static __inline __m128 __attribute__((__always_inline__))
_mm_rsqrt_ss (__m128 __A)
  return (__m128) __builtin_ia32_rsqrtss ((__v4sf)__A);

no call is actually made in the resulting assembly, so how can we describe
it as a trampoline?  Trampoline in the DWARF3 description needs to pass
control to somewhere else.

Even for memcpy inline itself when GCC decides to emit the copy inline
we can end up with no call and again describing that as a trampoline is
weird.  For others like read inline where we always call either
read or __read_chk DW_AT_trampoline would be usable.  But do we want
two different attributes?


More information about the Gcc-patches mailing list