http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39375
--- Comment #6 from Andrew Pinski 2012-01-02
04:16:52 UTC ---
__asm__ ("xxx" : "+X" (sum));
Is most likely what you want to use. This says the sum might be clobbered but
it might not be as the same value is used if it was not.
--- Comment #5 from pinskia at gcc dot gnu dot org 2009-03-16 17:02 ---
(In reply to comment #4)
> Reopening because
> int params; __asm__ ("xxx" : "=X" (params));
> and
> int params[1]; __asm__ ("xxx" : "=X" (params[0]));
> still produce different output in a way that is undocumented.
--- Comment #4 from balrogg at gmail dot com 2009-03-16 16:53 ---
Reopening because
int params; __asm__ ("xxx" : "=X" (params));
and
int params[1]; __asm__ ("xxx" : "=X" (params[0]));
still produce different output in a way that is undocumented.
--
balrogg at gmail dot com changed:
--- Comment #3 from balrogg at gmail dot com 2009-03-06 10:34 ---
(In reply to comment #2)
> You need to use a "memory" clobber instead. "=X" (params[1]) says to GCC
> that the asm operand 0 should be stored to params[1], which it does
> (it allocates %eax to it).
Note that "=r" doesn'
--- Comment #2 from rguenth at gcc dot gnu dot org 2009-03-05 10:42 ---
You need to use a "memory" clobber instead. "=X" (params[1]) says to GCC
that the asm operand 0 should be stored to params[1], which it does
(it allocates %eax to it). Note that plain use of %eax and %dx is a
bad i
--- Comment #1 from balrogg at gmail dot com 2009-03-05 02:55 ---
(In reply to comment #0)
> Similarly for "=X" but not "=m" or "=r".
Rather, similarly for "=g".
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39375