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