statement expressions and extended asm bug?
Nathan Sidwell
nathan@codesourcery.com
Mon Mar 15 14:03:00 GMT 2004
Gunther Nikl wrote:
> That would explain the behaviour. Are you sure that your interpretation
> is right? The documenation says:
>
> "...allows you to use loops, switches, and local variables within an
> expression."
correct
>>I suspect if you did not allocate variable _d0 to an explicit register,
>>then things would behave.
>
>
> Thats correct. If I assign the register variable to a non-register
> variable inside the expression, the generated code works as expected.
> However, if I understand you correctly that might be an accident
> nonetheless. Consider the maxint example from the documentation about
No, that's not an accident.
> statement expression. Using it twice in a function call should then
> also violate the sequence point constraints of C, shouldn't it?
no.
It is your explicit allocation of the two temporary variables into the
same register that is breaking things.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
More information about the Gcc
mailing list