public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184]
@ 2021-04-22 12:42 Jakub Jelinek
  2021-04-22 12:58 ` Jonathan Wakely
  2021-04-22 14:32 ` H.J. Lu
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Jelinek @ 2021-04-22 12:42 UTC (permalink / raw)
  To: Jonathan Wakely, libstdc++, Uros Bizjak; +Cc: gcc-patches

Hi!

gcc on ia32 miscompiles various atomics involving floating point,
unfortunately I'm afraid it is too late to fix that for 11.1 and
as I'm quite lost on it, it might take a while for 12 too
(disabling all the 8 peephole2s would be easiest, but then we'd
run into optimization regressions).

While 1.cc just FAILs, with dejagnu 1.6.1 wait_notify.cc hangs the
make check even after the timeout fires.  The following patch therefore
xfails the former and skips the latter.

Tested on x86_64-linux where
make check RUNTESTFLAGS='conformance.exp=atomic_float/*.cc'
is still
		=== libstdc++ Summary ===

# of expected passes		8
and on i686-linux, where it is now
		=== libstdc++ Summary ===

# of expected passes		5
# of expected failures		1
# of unsupported tests		1

Ok for trunk/11.1 ?

2021-04-22  Jakub Jelinek  <jakub@redhat.com>

	PR target/100182
	* testsuite/29_atomics_atomic_float/1.cc: Add dg-xfail-run-if for
	ia32.
	* testsuite/29_atomics/atomic_float/wait_notify.cc: Add dg-skip-if for
	ia32.

--- libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc.jj	2021-01-05 00:13:58.552294301 +0100
+++ libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc	2021-04-22 14:29:19.778374653 +0200
@@ -18,6 +18,7 @@
 // { dg-add-options ieee }
 // { dg-options "-std=gnu++2a" }
 // { dg-do run { target c++2a } }
+// { dg-xfail-run-if "PR100182" { ia32 } }
 
 #include <atomic>
 #include <testsuite_hooks.h>
--- libstdc++-v3/testsuite/29_atomics/atomic_float/wait_notify.cc.jj	2021-04-20 23:46:09.214189796 +0200
+++ libstdc++-v3/testsuite/29_atomics/atomic_float/wait_notify.cc	2021-04-22 14:28:19.793044944 +0200
@@ -2,6 +2,7 @@
 // { dg-do run { target c++2a } }
 // { dg-require-gthreads "" }
 // { dg-additional-options "-pthread" { target pthread } }
+// { dg-skip-if "PR100182" { ia32 } }
 // { dg-add-options libatomic }
 
 // Copyright (C) 2020-2021 Free Software Foundation, Inc.

	Jakub


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

* Re: [PATCH] libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184]
  2021-04-22 12:42 [PATCH] libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184] Jakub Jelinek
@ 2021-04-22 12:58 ` Jonathan Wakely
  2021-04-22 14:32 ` H.J. Lu
  1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Wakely @ 2021-04-22 12:58 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: libstdc++, Uros Bizjak, gcc-patches

On 22/04/21 14:42 +0200, Jakub Jelinek wrote:
>Hi!
>
>gcc on ia32 miscompiles various atomics involving floating point,
>unfortunately I'm afraid it is too late to fix that for 11.1 and
>as I'm quite lost on it, it might take a while for 12 too
>(disabling all the 8 peephole2s would be easiest, but then we'd
>run into optimization regressions).
>
>While 1.cc just FAILs, with dejagnu 1.6.1 wait_notify.cc hangs the
>make check even after the timeout fires.  The following patch therefore
>xfails the former and skips the latter.
>
>Tested on x86_64-linux where
>make check RUNTESTFLAGS='conformance.exp=atomic_float/*.cc'
>is still
>		=== libstdc++ Summary ===
>
># of expected passes		8
>and on i686-linux, where it is now
>		=== libstdc++ Summary ===
>
># of expected passes		5
># of expected failures		1
># of unsupported tests		1
>
>Ok for trunk/11.1 ?

OK, thanks.

>2021-04-22  Jakub Jelinek  <jakub@redhat.com>
>
>	PR target/100182
>	* testsuite/29_atomics_atomic_float/1.cc: Add dg-xfail-run-if for
>	ia32.
>	* testsuite/29_atomics/atomic_float/wait_notify.cc: Add dg-skip-if for
>	ia32.
>
>--- libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc.jj	2021-01-05 00:13:58.552294301 +0100
>+++ libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc	2021-04-22 14:29:19.778374653 +0200
>@@ -18,6 +18,7 @@
> // { dg-add-options ieee }
> // { dg-options "-std=gnu++2a" }
> // { dg-do run { target c++2a } }
>+// { dg-xfail-run-if "PR100182" { ia32 } }
>
> #include <atomic>
> #include <testsuite_hooks.h>
>--- libstdc++-v3/testsuite/29_atomics/atomic_float/wait_notify.cc.jj	2021-04-20 23:46:09.214189796 +0200
>+++ libstdc++-v3/testsuite/29_atomics/atomic_float/wait_notify.cc	2021-04-22 14:28:19.793044944 +0200
>@@ -2,6 +2,7 @@
> // { dg-do run { target c++2a } }
> // { dg-require-gthreads "" }
> // { dg-additional-options "-pthread" { target pthread } }
>+// { dg-skip-if "PR100182" { ia32 } }
> // { dg-add-options libatomic }
>
> // Copyright (C) 2020-2021 Free Software Foundation, Inc.
>
>	Jakub


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

* Re: [PATCH] libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184]
  2021-04-22 12:42 [PATCH] libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184] Jakub Jelinek
  2021-04-22 12:58 ` Jonathan Wakely
@ 2021-04-22 14:32 ` H.J. Lu
  1 sibling, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2021-04-22 14:32 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Jonathan Wakely, libstdc++, Uros Bizjak, gcc-patches

Wrong PR # in subject.

On Thu, Apr 22, 2021 at 7:11 AM Jakub Jelinek via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Hi!
>
> gcc on ia32 miscompiles various atomics involving floating point,
> unfortunately I'm afraid it is too late to fix that for 11.1 and
> as I'm quite lost on it, it might take a while for 12 too
> (disabling all the 8 peephole2s would be easiest, but then we'd
> run into optimization regressions).
>
> While 1.cc just FAILs, with dejagnu 1.6.1 wait_notify.cc hangs the
> make check even after the timeout fires.  The following patch therefore
> xfails the former and skips the latter.
>
> Tested on x86_64-linux where
> make check RUNTESTFLAGS='conformance.exp=atomic_float/*.cc'
> is still
>                 === libstdc++ Summary ===
>
> # of expected passes            8
> and on i686-linux, where it is now
>                 === libstdc++ Summary ===
>
> # of expected passes            5
> # of expected failures          1
> # of unsupported tests          1
>
> Ok for trunk/11.1 ?
>
> 2021-04-22  Jakub Jelinek  <jakub@redhat.com>
>
>         PR target/100182
>         * testsuite/29_atomics_atomic_float/1.cc: Add dg-xfail-run-if for
>         ia32.
>         * testsuite/29_atomics/atomic_float/wait_notify.cc: Add dg-skip-if for
>         ia32.
>
> --- libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc.jj      2021-01-05 00:13:58.552294301 +0100
> +++ libstdc++-v3/testsuite/29_atomics/atomic_float/1.cc 2021-04-22 14:29:19.778374653 +0200
> @@ -18,6 +18,7 @@
>  // { dg-add-options ieee }
>  // { dg-options "-std=gnu++2a" }
>  // { dg-do run { target c++2a } }
> +// { dg-xfail-run-if "PR100182" { ia32 } }
>
>  #include <atomic>
>  #include <testsuite_hooks.h>
> --- libstdc++-v3/testsuite/29_atomics/atomic_float/wait_notify.cc.jj    2021-04-20 23:46:09.214189796 +0200
> +++ libstdc++-v3/testsuite/29_atomics/atomic_float/wait_notify.cc       2021-04-22 14:28:19.793044944 +0200
> @@ -2,6 +2,7 @@
>  // { dg-do run { target c++2a } }
>  // { dg-require-gthreads "" }
>  // { dg-additional-options "-pthread" { target pthread } }
> +// { dg-skip-if "PR100182" { ia32 } }
>  // { dg-add-options libatomic }
>
>  // Copyright (C) 2020-2021 Free Software Foundation, Inc.
>
>         Jakub
>


-- 
H.J.

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

end of thread, other threads:[~2021-04-22 14:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22 12:42 [PATCH] libstdc++: Add workaround for ia32 floating atomics miscompilations [PR100184] Jakub Jelinek
2021-04-22 12:58 ` Jonathan Wakely
2021-04-22 14:32 ` H.J. Lu

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