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?


On Mon, Mar 15, 2004 at 03:20:08PM +0000, Nathan Sidwell wrote:
> Gunther Nikl wrote:
> >On Mon, Mar 15, 2004 at 02:03:10PM +0000, Nathan Sidwell wrote:
> >
> >>It is your explicit allocation of the two temporary variables into the
> >>same register that is breaking things.
> >
> >  Ok, thats what I wanted to know. So, if I assign the temporary explict
> >  register variable containing the result to a non-register variable, then
> >  the expressions become well-formed and don't violate other constraints,
> >  right?
> 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+.

  Gunther


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