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]
Other format: [Raw text]

[Bug inline-asm/32971] Inline asm with offset addressing fails to compile in 4.0+ without -O



------- 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


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