This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/37651] __sync_bool_compare_and_swap creates wrong code with -fPIC
- From: "brian at dessent dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Sep 2008 22:29:05 -0000
- Subject: [Bug target/37651] __sync_bool_compare_and_swap creates wrong code with -fPIC
- References: <bug-37651-9973@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from brian at dessent dot net 2008-09-25 22:29 -------
Subject: Re: __sync_bool_compare_and_swap creates wrong code
with -fPIC
You get that if the variable is auto, but if it's static the reference
is with a GOTOFF reloc:
xorl %edi, %edi
pushl %ebx
call .L6
.L6:
popl %ebx
addl $_GLOBAL_OFFSET_TABLE_+[.-.L6], %ebx
pushl %ecx
movl %edi, %ecx
xchgl %ebx, %edi
lock cmpxchg8b s_u64.1229@GOTOFF(%ebx)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37651