bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

simple-atomic: Fix compilation error on Solaris 10/x86_64 with cc


From: Bruno Haible
Subject: simple-atomic: Fix compilation error on Solaris 10/x86_64 with cc
Date: Fri, 19 Mar 2021 03:40:34 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-203-generic; KDE/5.18.0; x86_64; ; )

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  <bruno@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

[Prev in Thread] Current Thread [Next in Thread]