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/42984] gcc produces broken code when passing struct pointer to static inline function with asm()



------- Comment #1 from d dot g dot gorbachev at gmail dot com  2010-02-06 10:18 -------
I believe that GCC is correct, and you should write

  asm volatile ("swi #0" :: "r" (a), "m" (*t));

Quoting from <http://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html>:
> Note that in the following example the memory input is
> necessary, otherwise GCC might optimize the store to x away


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42984


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