public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/54754] New: [parallel mode] 'make check-parallel' only works on x86-64
@ 2012-09-29 18:07 redi at gcc dot gnu.org
  2012-09-29 20:38 ` [Bug libstdc++/54754] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2012-09-29 18:07 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 54754
           Summary: [parallel mode] 'make check-parallel' only works on
                    x86-64
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


include/parallel/compatibility.h uses an OpenMP critical section on all
platforms except x86_64, which issues messages that break the check-parallel
testsuite:

Running
/home/jwakely/src/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp ...
ERROR: tcl error sourcing
/home/jwakely/src/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp.
ERROR: could not compile testsuite_abi.cc
    while executing
"error "could not compile $f""
    (procedure "v3-build_support" line 61)
    invoked from within
"v3-build_support"
    (file
"/home/jwakely/src/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp"
line 25)
    invoked from within
"source
/home/jwakely/src/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source
/home/jwakely/src/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp"
    invoked from within
"catch "uplevel #0 source $test_file_name""


testsuite/parallel/libstdc++.log shows:

In file included from
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/parallel/find.h:40:0,
                 from
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/parallel/algobase.h:42,
                 from
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/bits/stl_algobase.h:1222,
                 from
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/algorithm:62,
                 from
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu/bits/stdc++.h:65,
                 from <command-line>:0:
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/parallel/compatibility.h:
In function 'int64_t __gnu_parallel::__fetch_and_add_64(volatile int64_t*,
int64_t)':
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/parallel/compatibility.h:167:42:
note: #pragma message: slow __fetch_and_add_64
 #pragma message("slow __fetch_and_add_64")
                                          ^
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/parallel/compatibility.h:
In function 'bool __gnu_parallel::__compare_and_swap_64(volatile int64_t*,
int64_t, int64_t)':
/home/jwakely/build/i686-pc-linux-gnu/libstdc++-v3/include/parallel/compatibility.h:320:45:
note: #pragma message: slow __compare_and_swap_64
 #pragma message("slow __compare_and_swap_64")
                                             ^


The parallel/compatibility.h header checks for 

#if defined(__x86_64)
  [use atomics]
#elif defined(__i386) &&                   \
  (defined(__i686) || defined(__pentium4) || defined(__athlon)  \
   || defined(__k8) || defined(__core2))
  [use atomics]
#else
  [use omp critical]
#endif

But __i686 isn't defined on i686, for example, and this doesn't handle
platforms such as power64 which support the necessary 64-bit ops.

Instead of a (broken) whitelist of targets the code could use
__atomic_always_lock_free to check for the availability of atomic ops on the
target.

Another possibility would be to add a new configure option:
   --enable-libstdcxx-parallel-atomics=[omp|libatomic]

The default would be to use the omp criticial section as it is now, the
libatomic option would force use of atomics, which would require libatomic for
platforms where the built-ins call a library function.


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

* [Bug libstdc++/54754] [parallel mode] 'make check-parallel' only works on x86-64
  2012-09-29 18:07 [Bug libstdc++/54754] New: [parallel mode] 'make check-parallel' only works on x86-64 redi at gcc dot gnu.org
@ 2012-09-29 20:38 ` redi at gcc dot gnu.org
  2012-09-29 22:54 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2012-09-29 20:38 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-09-29 20:37:59 UTC ---
Created attachment 28301
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28301
Use built-in atomics on non-x86_64 targets.

This patch uses __atomic_always_lock_free to check if the __atomic_* built-ins
can be used, which allows them to be used on more platforms than the current
preprocessor checks allow.


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

* [Bug libstdc++/54754] [parallel mode] 'make check-parallel' only works on x86-64
  2012-09-29 18:07 [Bug libstdc++/54754] New: [parallel mode] 'make check-parallel' only works on x86-64 redi at gcc dot gnu.org
  2012-09-29 20:38 ` [Bug libstdc++/54754] " redi at gcc dot gnu.org
@ 2012-09-29 22:54 ` paolo.carlini at oracle dot com
  2012-10-09  8:17 ` redi at gcc dot gnu.org
  2012-10-09  8:17 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-09-29 22:54 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-09-29 22:53:36 UTC ---
Jon, please, pursue the approach you like better and let's make progress on
this: remember that we are still in Stage 1, we can also take some little
risks.


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

* [Bug libstdc++/54754] [parallel mode] 'make check-parallel' only works on x86-64
  2012-09-29 18:07 [Bug libstdc++/54754] New: [parallel mode] 'make check-parallel' only works on x86-64 redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-10-09  8:17 ` redi at gcc dot gnu.org
@ 2012-10-09  8:17 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-09  8:17 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-09 08:16:36 UTC ---
Author: redi
Date: Tue Oct  9 08:16:13 2012
New Revision: 192240

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192240
Log:
    PR libstdc++/54754
    * include/parallel/compatibility.h: Use atomic built-ins when they are
    lock-free.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/parallel/compatibility.h


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

* [Bug libstdc++/54754] [parallel mode] 'make check-parallel' only works on x86-64
  2012-09-29 18:07 [Bug libstdc++/54754] New: [parallel mode] 'make check-parallel' only works on x86-64 redi at gcc dot gnu.org
  2012-09-29 20:38 ` [Bug libstdc++/54754] " redi at gcc dot gnu.org
  2012-09-29 22:54 ` paolo.carlini at oracle dot com
@ 2012-10-09  8:17 ` redi at gcc dot gnu.org
  2012-10-09  8:17 ` redi at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2012-10-09  8:17 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-10-09 08:17:22 UTC ---
fixed


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

end of thread, other threads:[~2012-10-09  8:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-29 18:07 [Bug libstdc++/54754] New: [parallel mode] 'make check-parallel' only works on x86-64 redi at gcc dot gnu.org
2012-09-29 20:38 ` [Bug libstdc++/54754] " redi at gcc dot gnu.org
2012-09-29 22:54 ` paolo.carlini at oracle dot com
2012-10-09  8:17 ` redi at gcc dot gnu.org
2012-10-09  8:17 ` redi 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).