Re: suboptimal code-gen of decrement in GCC 4.2.1
Re: suboptimal code-gen of decrement in GCC 4.2.1
- Subject: Re: suboptimal code-gen of decrement in GCC 4.2.1
- From: Greg Guerin <email@hidden>
- Date: Wed, 14 Oct 2009 17:24:06 -0700
Jens Alfke wrote:
void deref() { if (--m_refCount == 0) delete this; }
Two things come to mind:
1. Are any of the variables involved declared 'volatile'?
2. Are you looking at this code because measurements have shown it to
be significant, or is this purely a theoretical concern?
With the x86, more instructions aren't always slower, due to
pipelining and other architecture internals. Without knowing
specifics of the 'decl (ëx)' sequence of bus operations, maybe it's
doing an interlocked access that ends up slower than the longer
instruction sequence. In other words, it seems sub-optimal, but does
it really run sub-optimally?
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden