This is the mail archive of the gcc@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: Functions that are CSEable but not pure


On 10/11/2012 03:48 PM, Alexandre Oliva wrote:
This is not entirely clear to me; where is i defined in the first place?

Um, it's defined where the user writes the definition, like any other variable.


Is it i_init that defines and tests i_initialized?

Yes.


Consider instead the following expansion:

__thread void (*i_initialize)(void) = i_init;

That would work too, though it wouldn't have the benefit of link-compatibility with __thread (for variables that don't need dynamic initialization) that the current scheme has.


I don't know whether it would be more or less efficient.

or this:

[EXTERN] __thread T *i;

Same answer. If we aren't trying to maintain compatibility, this approach seems like it would be more efficient than i_initialize.


Jason


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