[Bug c/39375] asm with a =X output overwrites the output

2012-01-01 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39375 --- Comment #6 from Andrew Pinski pinskia at gcc dot gnu.org 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

[Bug c/39375] asm with a =X output overwrites the output

2009-03-16 Thread balrogg at gmail dot com
--- 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:

[Bug c/39375] asm with a =X output overwrites the output

2009-03-16 Thread pinskia at gcc dot gnu dot org
--- 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. How so? =X

[Bug c/39375] asm with a =X output overwrites the output

2009-03-06 Thread balrogg at gmail dot com
--- 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't

[Bug c/39375] asm with a =X output overwrites the output

2009-03-05 Thread rguenth at gcc dot gnu dot org
--- 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 idea

[Bug c/39375] asm with a =X output overwrites the output

2009-03-04 Thread balrogg at gmail dot com
--- 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