This is the mail archive of the gcc-bugs@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]

Re: Code that used to compile


Laurent.Kersten@alcatel.be writes:

> rdtsc.c:13: Invalid `asm' statement:
> rdtsc.c:13: fixed or forbidden register 0 (ax) was spilled for class AREG.

>   __asm__ __volatile__ ("rdtsc"
>                :"=a" (tsc.time_lh[0]), "=d" (tsc.time_lh[1])
>                :
>                :"ax", "dx");

The compiler is complaining that it can't find a register of class AREG,
because register 0 is fixed or forbidden.

You have asked for a register of this class by saying '=a', and you have
asked for it to be forbidden by saying that the asm clobbers "ax".  Since
there's only one AREG register, you can't do both of these at the same time.

-- 
- Geoffrey Keating <geoffk@geoffk.org>

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