From 72217b5ddb2a15e2606f4b15b147dd59fe8e6216 Mon Sep 17 00:00:00 2001 From: Ilya Leoshkevich Date: Thu, 3 Dec 2020 02:02:20 +0100 Subject: [PATCH] IBM Z: Build autovec-*-signaling-eq.c tests with exceptions 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 * 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 | 2 +- gcc/testsuite/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 a8402b9..3645d3c 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 7dd91a5..d98aa0c 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.7.4