public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/37651] New: __sync_bool_compare_and_swap creates wrong code with -fPIC
@ 2008-09-25 19:46 fm3 at os dot inf dot tu-dresden dot de
2008-09-25 21:37 ` [Bug target/37651] " pinskia at gcc dot gnu dot org
2008-09-25 22:30 ` brian at dessent dot net
0 siblings, 2 replies; 4+ messages in thread
From: fm3 at os dot inf dot tu-dresden dot de @ 2008-09-25 19:46 UTC (permalink / raw)
To: gcc-bugs
The following example dumps a core if compiled with -march=i586 -fPIC:
#include <stdint.h>
int main(void)
{
static uint64_t volatile s_u64;
__sync_bool_compare_and_swap(&s_u64, 0, 0);
}
The reason is that %ebx will be used as pointer for the memory variable.
I can reproduce this bug so far with gcc-4.2 and gcc-4.3.2 (both Debian Sid).
$ gcc -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-targets=all --enable-cld
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.3.2 (Debian 4.3.2-1)
--
Summary: __sync_bool_compare_and_swap creates wrong code with -
fPIC
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fm3 at os dot inf dot tu-dresden dot de
GCC build triplet: i486-linux-gnu
GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37651
^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <bug-37651-4@http.gcc.gnu.org/bugzilla/>]
end of thread, other threads:[~2012-01-06 10:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-25 19:46 [Bug target/37651] New: __sync_bool_compare_and_swap creates wrong code with -fPIC fm3 at os dot inf dot tu-dresden dot de
2008-09-25 21:37 ` [Bug target/37651] " pinskia at gcc dot gnu dot org
2008-09-25 22:30 ` brian at dessent dot net
[not found] <bug-37651-4@http.gcc.gnu.org/bugzilla/>
2012-01-06 10:19 ` aph at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).