public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] IBM Z: Build autovec-*-signaling-eq.c tests with exceptions
@ 2020-12-03  1:22 Ilya Leoshkevich
  2020-12-09  6:49 ` Andreas Krebbel
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Leoshkevich @ 2020-12-03  1:22 UTC (permalink / raw)
  To: gcc-patches

According to
https://gcc.gnu.org/pipermail/gcc/2020-November/234344.html, GCC is
allowed to perform optimizations that remove floating point traps,
since they do not affect the modeled control flow.  This interferes with
two signaling comparison tests, where (a <= b && a >= b) is turned into
(a <= b && a == b) by test_for_singularity, into ((a <= b) & (a == b))
by vectorizer and then into (a == b) eliminate_redundant_comparison.

Fix by making traps affect the control flow by turning them into
exceptions.

gcc/testsuite/ChangeLog:

2020-12-03  Ilya Leoshkevich  <iii@linux.ibm.com>

	* gcc.target/s390/zvector/autovec-double-signaling-eq.c: Build
	with exceptions.
	* gcc.target/s390/zvector/autovec-float-signaling-eq.c:
	Likewise.
---
 .../gcc.target/s390/zvector/autovec-double-signaling-eq.c       | 2 +-
 .../gcc.target/s390/zvector/autovec-float-signaling-eq.c        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c
index a8402b9f705..3645d3cc393 100644
--- a/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c
+++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch -fexceptions -fnon-call-exceptions" } */
 
 #include "autovec.h"
 
diff --git a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c
index 7dd91a5e6f3..d98aa0c494e 100644
--- a/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c
+++ b/gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O3 -march=z14 -mzvector -mzarch" } */
+/* { dg-options "-O3 -march=z14 -mzvector -mzarch -fexceptions -fnon-call-exceptions" } */
 
 #include "autovec.h"
 
-- 
2.25.4


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

* Re: [PATCH] IBM Z: Build autovec-*-signaling-eq.c tests with exceptions
  2020-12-03  1:22 [PATCH] IBM Z: Build autovec-*-signaling-eq.c tests with exceptions Ilya Leoshkevich
@ 2020-12-09  6:49 ` Andreas Krebbel
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Krebbel @ 2020-12-09  6:49 UTC (permalink / raw)
  To: Ilya Leoshkevich, gcc-patches

On 12/3/20 2:22 AM, Ilya Leoshkevich wrote:
> According to
> https://gcc.gnu.org/pipermail/gcc/2020-November/234344.html, GCC is
> allowed to perform optimizations that remove floating point traps,
> since they do not affect the modeled control flow.  This interferes with
> two signaling comparison tests, where (a <= b && a >= b) is turned into
> (a <= b && a == b) by test_for_singularity, into ((a <= b) & (a == b))
> by vectorizer and then into (a == b) eliminate_redundant_comparison.
> 
> Fix by making traps affect the control flow by turning them into
> exceptions.
> 
> gcc/testsuite/ChangeLog:
> 
> 2020-12-03  Ilya Leoshkevich  <iii@linux.ibm.com>
> 
> 	* gcc.target/s390/zvector/autovec-double-signaling-eq.c: Build
> 	with exceptions.
> 	* gcc.target/s390/zvector/autovec-float-signaling-eq.c:
> 	Likewise.

Ok. Thanks!

Andreas

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

end of thread, other threads:[~2020-12-09  6:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  1:22 [PATCH] IBM Z: Build autovec-*-signaling-eq.c tests with exceptions Ilya Leoshkevich
2020-12-09  6:49 ` Andreas Krebbel

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