This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: asm constraints
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: "Zvilius, Mark" <Mark dot Zvilius at fluke dot com>
- Cc: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Fri, 27 Aug 2004 11:17:12 +0200
- Subject: Re: asm constraints
- References: <732BE51FE9901143AE04411A11CC46560484AAB5@evtexc02.tc.fluke.com>
unsigned int tbl;
__asm__("mftbl %0" : "=r" (tbl));
[side note: mftbl is not a PowerPC insn, nor an assembler
extended mnemonic. I have no idea why libopcodes accepts
it].
I'm wondering why it's wasting a register.
Did you compile with optimization on? If so, what compiler
version did you use? I tried with 3.4.1 and it works just
fine. If you still have problems, please show the exact code
(full routine, compilable as-is).
Am I specifying the constraint incorrectly?
No, it's fine.
Segher