Hi everybody,

gcc 4.5.1 with -O2 optimizes the 'ret = newval' away because %0 is
declared as being write only.
Fix is attached.

Regards

Nicolai
--- a/openmpi-1.4.3/opal/include/opal/sys/sparcv9/atomic.h	2009-12-08 21:36:02.000000000 +0100
+++ openmpi-1.4.3/opal/include/opal/sys/sparcv9/atomic.h	2010-11-12 21:20:28.356657500 +0100
@@ -159,7 +159,7 @@
                        "ldx %2, %%g2               \n\t" /* g2 = oldval */
                        "casxa [%1] " ASI_P ", %%g2, %%g1 \n\t"
                        "stx %%g1, %0               \n"
-                       : "=m"(ret)
+                       : "+m"(ret)
                        : "r"(addr), "m"(oldval)
                        : "%g1", "%g2"
                        );

Reply via email to