[Boost-bugs] [Boost C++ Libraries] #12804: Can't compiler boost::atomic<> on AIX.ppc with GCC

Subject: [Boost-bugs] [Boost C++ Libraries] #12804: Can't compiler boost::atomic<> on AIX.ppc with GCC
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-02-02 07:39:03


#12804: Can't compiler boost::atomic<> on AIX.ppc with GCC
------------------------------+--------------------------
 Reporter: dima.ru.com@… | Owner: timblechmann
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: atomic
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
------------------------------+--------------------------
 Hello,

 I'm trying to use boost::atomic<> on AIX.ppc (v7.1) box and compile code
 with GCC. But unfortunately, the code below fails to compile :



 ----

 {{{
 inline boost::uint32_t atomic_cas32
    (volatile boost::uint32_t *mem, boost::uint32_t with, boost::uint32_t
 cmp)
 {
    boost::uint32_t prev;

    asm volatile ("1:\n\t" 
                  "lwarx %0,0,%1\n\t"
                  "cmpw %0,%3\n\t"
                  "bne- 2f\n\t" 
                  "stwcx. %2,0,%1\n\t"
                  "bne- 1b\n\t" 
                  "2:" 
                  : "=&r"(prev)
                  : "b" (mem), "r" (with), "r" (cmp)
                  : "cc", "memory");
    return prev;
 }

 }}}

 AIX assembler (/usr/bin/as) execution fails with error saying that "labels
 need to follow the symbol rules".
 Simple change from "1:\n\t" to "t_1:\n\t" fixes the issue.

 I have a question :
 '''Is boost::atomic<> is designed to be compiled with GCC on AIX.ppc ? Or
 should it be used only with native xlC compiler ?'''



 ----

 Environment :

 {{{
 -bash-4.3$ as -v
 as V7.1

 -bash-4.3$ gcc -v
 Using built-in specs.
 COLLECT_GCC=gcc
 COLLECT_LTO_WRAPPER=/opt/freeware/libexec/gcc/powerpc-ibm-aix7.1.0.0/4.8.5
 /lto-wrapper
 Target: powerpc-ibm-aix7.1.0.0
 Configured with: ../gcc-4.8.5/configure --prefix=/opt/freeware
 --mandir=/opt/freeware/man --infodir=/opt/freeware/info --with-local-
 prefix=/opt/freeware --with-as=/usr/bin/as --with-ld=/usr/bin/ld --enable-
 languages=c,c++,fortran --enable-version-specific-runtime-libs --disable-
 nls --enable-decimal-float=dpd --with-cloog=no --with-ppl=no --disable-
 libstdcxx-pch --enable-__cxa_atexit
 Thread model: aix
 gcc version 4.8.5 (GCC)
 -bash-4.3$

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12804>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:21 UTC