This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/32971] Inline asm with offset addressing fails to compile in 4.0+ without -O
- From: "kinetik at orcon dot net dot nz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Aug 2007 04:51:34 -0000
- Subject: [Bug inline-asm/32971] Inline asm with offset addressing fails to compile in 4.0+ without -O
- References: <bug-32971-10461@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from kinetik at orcon dot net dot nz 2007-08-03 04:51 -------
Using a memory operand to pass the offset value is not ideal in the first
place, but I'm not sure how else I can do it. It looks like the "i" contraint
(immediate value) is what I want, but the following code:
asm ("lea %1(%2), %0"
: "=r" (i)
: "i" (offsetof(struct coord, y)),
"r" (c)
: "memory");
...generates the following assembly, which gas fails to assemble due to syntax
errors:
lea $4(%eax), %eax
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32971