IBM Z: Build autovec-*-signaling-eq.c tests with exceptions
authorIlya Leoshkevich <iii@linux.ibm.com>
Thu, 3 Dec 2020 01:02:20 +0000 (02:02 +0100)
committerIlya Leoshkevich <iii@linux.ibm.com>
Wed, 9 Dec 2020 12:47:14 +0000 (13:47 +0100)
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/testsuite/gcc.target/s390/zvector/autovec-double-signaling-eq.c
gcc/testsuite/gcc.target/s390/zvector/autovec-float-signaling-eq.c

index a8402b9f70520a14b79e8d695c59ccbb9637220b..3645d3cc3937ab3d85dbc10c7b2049eff7f2554d 100644 (file)
@@ -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"
 
index 7dd91a5e6f3b047e6797b58ecab8d197e3803749..d98aa0c494ee9b95bec149fc32967cd97fb66b8d 100644 (file)
@@ -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"