This is the mail archive of the gcc-patches@gcc.gnu.org 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: [PATCH][libcpp] New deferred output pragma


> Why can't you use a nested function and __COUNTER__?

We can't use nested functions as we need to apply special attributes to
the generated function to ensure it appears in a different memory
segment.
This isn't possible with nested functions - they don't appear to accept
attributes.


-----Original Message-----
From: Paolo Bonzini [mailto:paolo.bonzini@gmail.com] On Behalf Of Paolo
Bonzini
Sent: 13 April 2010 17:41
To: David Stubbs
Cc: Basile Starynkevitch; tromey@redhat.com; gcc-patches@gcc.gnu.org;
sdkteam-gnu
Subject: Re: [PATCH][libcpp] New deferred output pragma

On 04/13/2010 08:51 AM, David Stubbs wrote:
>> But I also would like more detailed discussion of why this patch
>> &
>> deferred_output pragma is useful. Could the original poster
>> (Devid
>> Stubbs?) give some realistic uses cases? Why does he want the
>> patch?
>
> We use this patch in combination with the patch posted by my colleague
> Rahul (http://gcc.gnu.org/ml/gcc-patches/2010-04/msg00581.html).
>
> We have some assert macros that previously expanded to a lot of inline
> code. We now generate a thunk for these macros to reduce the amount of
> inline code, and use section attributes on the generated function to
> place it in a less expensive memory segment.

Why can't you use a nested function and __COUNTER__?

Paolo


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