public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/47460] New: Inconsistent behaviour of __sync_fetch_and_add builtin?
@ 2011-01-25 16:34 manuel.holtgrewe@fu-berlin.de
  2011-01-25 16:48 ` [Bug tree-optimization/47460] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: manuel.holtgrewe@fu-berlin.de @ 2011-01-25 16:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47460

           Summary: Inconsistent behaviour of __sync_fetch_and_add
                    builtin?
           Product: gcc
           Version: 4.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: manuel.holtgrewe@fu-berlin.de


I get the unexpected (for me) inconsistent behaviour of the
__sync_fetch_and_add builtin with the program below. My main confusion is
around the missing __sync_val_compare_and_swap_{1,2,4} when not explicitely
specifying the architecture in GCC 4.4.5, but availability in all other tried
variants.

Also, why is there a 64-bit variant when explicitely giving -march=i686 to g++
>=4.2 but missing one in g++-4.1?

Thanks!

Program gcc-atomic.cpp
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<

template <typename T>
void test()
{
  T volatile x = 0;
  T y = 0;
  T z = 0;
  __sync_fetch_and_add(&x, y, z);
  __sync_fetch_and_or(&x, y, z);
  __sync_fetch_and_xor(&x, y, z);
  __sync_val_compare_and_swap(&x, y, z);
}

int main()
{
  test<char>();
  test<unsigned char>();
  test<int>();
  test<unsigned int>();
  test<short>();
  test<unsigned short>();
  test<long>();
  test<unsigned long>();
  test<long long>();
  test<unsigned long long>();
  return 0;
}


Output WITH -march=i686 switch
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<


$ for i in 1 2 3 4 5; do g++-4.$i --version; g++-4.$i -dumpmachine; g++-4.$i
-march=i686 gcc-atomic.cpp; done
g++-4.1 (GCC) 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i486-linux-gnu
/tmp/cce8mfQl.o: In function `void test<long long>()':
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x46): undefined
reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x5f): undefined
reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x78): undefined
reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x9f): undefined
reference to `__sync_val_compare_and_swap_8'
/tmp/cce8mfQl.o: In function `void test<unsigned long long>()':
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x45):
undefined reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x5e):
undefined reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x77):
undefined reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x9e):
undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status
g++-4.2 (GCC) 4.2.4 (Debian 4.2.4-6)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i486-linux-gnu
g++-4.3 (Debian 4.3.2-1.1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i486-linux-gnu
g++-4.4.5 (GCC) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i686-pc-linux-gnu
g++-4.5.1 (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i686-pc-linux-gnu


Output WITHOUT -march=i686 switch
--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<

$ for i in 1 2 3 4 5; do g++-4.$i --version; g++-4.$i -dumpmachine; g++-4.$i
gcc-atomic.cpp; done
g++-4.1 (GCC) 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i486-linux-gnu
/tmp/ccGnLtMn.o: In function `void test<long long>()':
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x46): undefined
reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x5f): undefined
reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x78): undefined
reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x9f): undefined
reference to `__sync_val_compare_and_swap_8'
/tmp/ccGnLtMn.o: In function `void test<unsigned long long>()':
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x45):
undefined reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x5e):
undefined reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x77):
undefined reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x9e):
undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status
g++-4.2 (GCC) 4.2.4 (Debian 4.2.4-6)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i486-linux-gnu
/tmp/ccgFK94L.o: In function `void test<long long>()':
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x46): undefined
reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x5f): undefined
reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x78): undefined
reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x9f): undefined
reference to `__sync_val_compare_and_swap_8'
/tmp/ccgFK94L.o: In function `void test<unsigned long long>()':
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x45):
undefined reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x5e):
undefined reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x77):
undefined reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x9e):
undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status
g++-4.3 (Debian 4.3.2-1.1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i486-linux-gnu
/tmp/ccM6VgC4.o: In function `void test<long long>()':
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x46): undefined
reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x5f): undefined
reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x78): undefined
reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x9f): undefined
reference to `__sync_val_compare_and_swap_8'
/tmp/ccM6VgC4.o: In function `void test<unsigned long long>()':
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x45):
undefined reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x5e):
undefined reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x77):
undefined reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x9e):
undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status
g++-4.4.5 (GCC) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i686-pc-linux-gnu
/tmp/ccmEomIy.o: In function `void test<char>()':
gcc-atomic.cpp:(.text._Z4testIcEvv[void test<char>()]+0x56): undefined
reference to `__sync_val_compare_and_swap_1'
/tmp/ccmEomIy.o: In function `void test<unsigned char>()':
gcc-atomic.cpp:(.text._Z4testIhEvv[void test<unsigned char>()]+0x47): undefined
reference to `__sync_val_compare_and_swap_1'
/tmp/ccmEomIy.o: In function `void test<int>()':
gcc-atomic.cpp:(.text._Z4testIiEvv[void test<int>()]+0x4b): undefined reference
to `__sync_val_compare_and_swap_4'
/tmp/ccmEomIy.o: In function `void test<unsigned int>()':
gcc-atomic.cpp:(.text._Z4testIjEvv[void test<unsigned int>()]+0x4b): undefined
reference to `__sync_val_compare_and_swap_4'
/tmp/ccmEomIy.o: In function `void test<short>()':
gcc-atomic.cpp:(.text._Z4testIsEvv[void test<short>()]+0x5f): undefined
reference to `__sync_val_compare_and_swap_2'
/tmp/ccmEomIy.o: In function `void test<unsigned short>()':
gcc-atomic.cpp:(.text._Z4testItEvv[void test<unsigned short>()]+0x50):
undefined reference to `__sync_val_compare_and_swap_2'
/tmp/ccmEomIy.o: In function `void test<long>()':
gcc-atomic.cpp:(.text._Z4testIlEvv[void test<long>()]+0x4b): undefined
reference to `__sync_val_compare_and_swap_4'
/tmp/ccmEomIy.o: In function `void test<unsigned long>()':
gcc-atomic.cpp:(.text._Z4testImEvv[void test<unsigned long>()]+0x4b): undefined
reference to `__sync_val_compare_and_swap_4'
/tmp/ccmEomIy.o: In function `void test<long long>()':
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x46): undefined
reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x5f): undefined
reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x78): undefined
reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIxEvv[void test<long long>()]+0x9f): undefined
reference to `__sync_val_compare_and_swap_8'
/tmp/ccmEomIy.o: In function `void test<unsigned long long>()':
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x45):
undefined reference to `__sync_fetch_and_add_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x5e):
undefined reference to `__sync_fetch_and_or_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x77):
undefined reference to `__sync_fetch_and_xor_8'
gcc-atomic.cpp:(.text._Z4testIyEvv[void test<unsigned long long>()]+0x9e):
undefined reference to `__sync_val_compare_and_swap_8'
collect2: ld returned 1 exit status
g++-4.5.1 (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i686-pc-linux-gnu


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/47460] Inconsistent behaviour of __sync_fetch_and_add builtin?
  2011-01-25 16:34 [Bug tree-optimization/47460] New: Inconsistent behaviour of __sync_fetch_and_add builtin? manuel.holtgrewe@fu-berlin.de
@ 2011-01-25 16:48 ` redi at gcc dot gnu.org
  2011-01-25 16:53 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-01-25 16:48 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47460

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-25 16:40:50 UTC ---
This seems more appropriate as a question to the gcc-help list requesting
clarification, not a bug report.

To answer part of it ...

(In reply to comment #0)
> I get the unexpected (for me) inconsistent behaviour of the
> __sync_fetch_and_add builtin with the program below. My main confusion is
> around the missing __sync_val_compare_and_swap_{1,2,4} when not explicitely
> specifying the architecture in GCC 4.4.5, but availability in all other tried
> variants.

You need to look at the output of 'gcc -v' to see if each GCC was built with
--with-arch, which specifies a default value for -march.

Prior to GCC 4.5, the default arch was i386 unless GCC was built with the
--with-arch switch.  Since GCC 4.5 the default arch is implied by the target
machine.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/47460] Inconsistent behaviour of __sync_fetch_and_add builtin?
  2011-01-25 16:34 [Bug tree-optimization/47460] New: Inconsistent behaviour of __sync_fetch_and_add builtin? manuel.holtgrewe@fu-berlin.de
  2011-01-25 16:48 ` [Bug tree-optimization/47460] " redi at gcc dot gnu.org
@ 2011-01-25 16:53 ` redi at gcc dot gnu.org
  2011-01-25 17:00 ` manuel.holtgrewe@fu-berlin.de
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-01-25 16:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47460

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-25 16:42:43 UTC ---
My guess is that the Debian packages are built with --with-arch=i486 but your
4.4.5 build isn't (and your 4.5.1 build doesn't need to be as it's implied by
the i686-pc-linux-gnu target)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/47460] Inconsistent behaviour of __sync_fetch_and_add builtin?
  2011-01-25 16:34 [Bug tree-optimization/47460] New: Inconsistent behaviour of __sync_fetch_and_add builtin? manuel.holtgrewe@fu-berlin.de
  2011-01-25 16:48 ` [Bug tree-optimization/47460] " redi at gcc dot gnu.org
  2011-01-25 16:53 ` redi at gcc dot gnu.org
@ 2011-01-25 17:00 ` manuel.holtgrewe@fu-berlin.de
  2011-01-25 17:04 ` redi at gcc dot gnu.org
  2011-01-25 17:10 ` manuel.holtgrewe@fu-berlin.de
  4 siblings, 0 replies; 6+ messages in thread
From: manuel.holtgrewe@fu-berlin.de @ 2011-01-25 17:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47460

--- Comment #3 from Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de> 2011-01-25 16:53:23 UTC ---
Sorry for posting this here again, but could somebody clarify the following,
nevertheless and if this is expected behaviour, close the bug as invalid? In
the future, I'll first try to ask on the list.

Versions 4.4 and 4.5 were built with the same parameters (modulo some
libraries), so my question is: Why are the __sync_fetch* builtins not found in
4.4 by default? Is this related to the configure parameters?

  --with-cloog=/group/agabi/software/i686/gcc-4.4.5
--with-ppl=/group/agabi/software/i686/gcc-4.4.5


--8<--8<--8<--8<--8<--8<--8<--8<--8<--8<--

$ for i in 1 2 3 4 5; do g++-4.$i --version; g++-4.$i -v; done
g++-4.1 (GCC) 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --enable-languages=c,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.1.3 --program-suffix=-4.1
--enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug
--with-tune=generic --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)
g++-4.2 (GCC) 4.2.4 (Debian 4.2.4-6)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--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.2
--program-suffix=-4.2 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-targets=all --with-tune=generic
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu
Thread model: posix
gcc version 4.2.4 (Debian 4.2.4-6)
g++-4.3 (Debian 4.3.2-1.1) 4.3.2
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.3.2-1.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.1) 
g++-4.4.5 (GCC) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../../gcc-4.4.5/configure
--prefix=/group/agabi/software/i686/gcc-4.4.5
--with-mpfr=/group/agabi/software/i686/gcc-4.4.5
--with-mpfr-lib=/group/agabi/software/i686/gcc-4.4.5/lib
--with-gmp=/group/agabi/software/i686/gcc-4.4.5
--with-mpc=/group/agabi/software/i686/gcc-4.4.5
--with-cloog=/group/agabi/software/i686/gcc-4.4.5
--with-ppl=/group/agabi/software/i686/gcc-4.4.5 --enable-languages=c,c++
--program-suffix=-4.4.5
Thread model: posix
gcc version 4.4.5 (GCC) 
g++-4.5.1 (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Using built-in specs.
COLLECT_GCC=/group/agabi/software/i686/gcc-4.5.1/bin/g++-4.5.1
COLLECT_LTO_WRAPPER=/group/agabi/software/i686/gcc-4.5.1/libexec/gcc/i686-pc-linux-gnu/4.5.1/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../configure --prefix=/group/agabi/software/i686/gcc-4.5.1
--with-mpfr=/group/agabi/software/i686/gcc-4.5.1
--with-mpfr-lib=/group/agabi/software/i686/gcc-4.5.1/lib
--with-gmp=/group/agabi/software/i686/gcc-4.5.1
--with-mpc=/group/agabi/software/i686/gcc-4.5.1 --enable-languages=c,c++
--program-suffix=-4.5.1
Thread model: posix
gcc version 4.5.1 (GCC)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/47460] Inconsistent behaviour of __sync_fetch_and_add builtin?
  2011-01-25 16:34 [Bug tree-optimization/47460] New: Inconsistent behaviour of __sync_fetch_and_add builtin? manuel.holtgrewe@fu-berlin.de
                   ` (2 preceding siblings ...)
  2011-01-25 17:00 ` manuel.holtgrewe@fu-berlin.de
@ 2011-01-25 17:04 ` redi at gcc dot gnu.org
  2011-01-25 17:10 ` manuel.holtgrewe@fu-berlin.de
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2011-01-25 17:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47460

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-01-25 16:59:49 UTC ---
(In reply to comment #3)
> 
> Versions 4.4 and 4.5 were built with the same parameters (modulo some
> libraries), so my question is: Why are the __sync_fetch* builtins not found in
> 4.4 by default? Is this related to the configure parameters?
> 
>   --with-cloog=/group/agabi/software/i686/gcc-4.4.5
> --with-ppl=/group/agabi/software/i686/gcc-4.4.5

No, it's because (as I already said) the default for -march is implied by the
target in 4.5, but not in 4.4

So your 4.5.1 build with i686 target defaults to -march=i686. Your 4.4.5 build
does not.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/47460] Inconsistent behaviour of __sync_fetch_and_add builtin?
  2011-01-25 16:34 [Bug tree-optimization/47460] New: Inconsistent behaviour of __sync_fetch_and_add builtin? manuel.holtgrewe@fu-berlin.de
                   ` (3 preceding siblings ...)
  2011-01-25 17:04 ` redi at gcc dot gnu.org
@ 2011-01-25 17:10 ` manuel.holtgrewe@fu-berlin.de
  4 siblings, 0 replies; 6+ messages in thread
From: manuel.holtgrewe@fu-berlin.de @ 2011-01-25 17:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47460

Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #5 from Manuel Holtgrewe <manuel.holtgrewe@fu-berlin.de> 2011-01-25 17:02:19 UTC ---
Thanks for clarifying, Jonathan. Sorry for preemptively adding this as a bug.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-01-25 17:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-25 16:34 [Bug tree-optimization/47460] New: Inconsistent behaviour of __sync_fetch_and_add builtin? manuel.holtgrewe@fu-berlin.de
2011-01-25 16:48 ` [Bug tree-optimization/47460] " redi at gcc dot gnu.org
2011-01-25 16:53 ` redi at gcc dot gnu.org
2011-01-25 17:00 ` manuel.holtgrewe@fu-berlin.de
2011-01-25 17:04 ` redi at gcc dot gnu.org
2011-01-25 17:10 ` manuel.holtgrewe@fu-berlin.de

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).