Fwd: Problem report: Struct aliasing problem causes Thread_Ready_Chain corruption in

Peer Stritzinger peerst at gmail.com
Tue Nov 21 16:45:45 UTC 2006

On 11/21/06, Thomas Doerfler <Thomas.Doerfler at embedded-brains.de> wrote:
> Ralf Corsepius schrieb:
> > Please prove Joel's patch to be broken

> The intermediate local variable "node" can easily be optimized by the
> compiler. For the compiler, it should be obvious, that "node" is a
> direct alias for "(Chain_Node *)ptr". So I don't see ANY reason, what
> this additional variable would change in the compiler's behavior.

Thats actually a part where GCC got a lot better ... keeping pointers
even those in complicated data structures in registers.

> It MAY BE, that this change produces different code, but I don't see,
> why the code should be more correct.

I agree.  And shouldn't it rather be proven that the code behaves well under
strict strict-aliasing no matter how smart the compiler gets instead
of the other way round.

-- Peer

More information about the users mailing list