This is the mail archive of the
mailing list for the GCC project.
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
Is it i_init that defines and tests i_initialized?
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.
[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.