This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: statement expressions and extended asm bug?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]