On Solaris 10 with cc I see this compilation error:

cc -D_STDC_C99= -xarch=generic64 -O -DHAVE_CONFIG_H -I. -I../../gllib -I..  
-DGNULIB_STRICT_CHECKING=1  -I/home/haible/prefix-x86_64/include -D_REENTRANT  
-g -c -o simple-atomic.o ../../gllib/simple-atomic.c
Assembler: simple-atomic.c
        "/tmp/GAA45ayy3", line 97 : Syntax error
        Near line: " movl %rsi,%rax"
cc: ube failed for ../../gllib/simple-atomic.c
*** Error code 2

This patch fixes it.


2021-03-18  Bruno Haible  <br...@clisp.org>

        simple-atomic: Fix compilation error on Solaris 10/x86_64 with cc.
        * lib/simple-atomic.c (atomic_compare_and_swap_ptr): Correct asm
        instruction.

diff --git a/lib/simple-atomic.c b/lib/simple-atomic.c
index 7c4f7e9..017fb56 100644
--- a/lib/simple-atomic.c
+++ b/lib/simple-atomic.c
@@ -277,7 +277,7 @@ atomic_compare_and_swap_ptr (uintptr_t volatile *vp,
   return oldval;
 #  else /* __SUNPRO_C */
 #   if defined __x86_64__
-  asm (" movl %rsi,%rax\n"
+  asm (" movq %rsi,%rax\n"
        " lock\n cmpxchgq %rdx,(%rdi)");
 #   elif defined __i386
   asm (" movl 16(%ebp),%ecx\n"


Reply via email to