statement expressions and extended asm bug?

Nathan Sidwell nathan@codesourcery.com
Mon Mar 15 15:54:00 GMT 2004


Gunther Nikl wrote:
> On Mon, Mar 15, 2004 at 03:20:08PM +0000, Nathan Sidwell wrote:

>>If you are asking whether
>>  ({int i; int j __asm__("d0"); volatile asm ("..." : "=r"(j)...); i = j; i;})
>>will DTRT, the answer is no.
> 
> 
>   I was considering writing it like this:
> 
>     ({ int i = \
>        ({int j __asm__("d0"); volatile asm ("..." : "=r"(j)...); j;}); \
>        i; \
>     })
> 
>   This seems to work with 3.3+.
that is equivalent to my example, the code still looks like it is undefined.

Why must you assign j to register d0?

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