From ef57eeb23260872cb601a848493488c24cb309c1 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Tue, 23 Jan 2018 10:42:32 +0000 Subject: [PATCH] Fix vect_float markup for a couple of tests (PR 83888) vect_float is true for arm*-*-* targets, but the support is only available when -funsafe-math-optimizations is on. This caused failures in two tests that disable fast-math. The easiest fix seemed to be to add a new target selector for "vect_float without special options". 2018-01-23 Richard Sandiford gcc/ PR testsuite/83888 * doc/sourcebuild.texi (vect_float): Say that the selector only describes the situation when -funsafe-math-optimizations is on. (vect_float_strict): Document. gcc/testsuite/ PR testsuite/83888 * lib/target-supports.exp (check_effective_target_vect_float): Say that the result only holds when -funsafe-math-optimizations is on. (check_effective_target_vect_float_strict): New procedure. * gcc.dg/vect/no-fast-math-vect16.c: Use vect_float_strict instead of vect_float. * gcc.dg/vect/vect-reduc-6.c: Likewise. From-SVN: r256977 --- gcc/ChangeLog | 7 +++++++ gcc/doc/sourcebuild.texi | 8 +++++++- gcc/testsuite/ChangeLog | 10 ++++++++++ gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c | 2 +- gcc/testsuite/gcc.dg/vect/vect-reduc-6.c | 2 +- gcc/testsuite/lib/target-supports.exp | 11 ++++++++++- 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bf5743b4dc4..94f2ad75ce1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-01-23 Richard Sandiford + + PR testsuite/83888 + * doc/sourcebuild.texi (vect_float): Say that the selector + only describes the situation when -funsafe-math-optimizations is on. + (vect_float_strict): Document. + 2018-01-23 Richard Sandiford PR tree-optimization/83965 diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 69fbf6ac768..bf44d158683 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -1403,7 +1403,13 @@ The target's preferred vector alignment is the same as the element alignment. @item vect_float -Target supports hardware vectors of @code{float}. +Target supports hardware vectors of @code{float} when +@option{-funsafe-math-optimizations} is in effect. + +@item vect_float_strict +Target supports hardware vectors of @code{float} when +@option{-funsafe-math-optimizations} is not in effect. +This implies @code{vect_float}. @item vect_int Target supports hardware vectors of @code{int}. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b42031bbd65..b684430fccb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2018-01-23 Richard Sandiford + + PR testsuite/83888 + * lib/target-supports.exp (check_effective_target_vect_float): Say + that the result only holds when -funsafe-math-optimizations is on. + (check_effective_target_vect_float_strict): New procedure. + * gcc.dg/vect/no-fast-math-vect16.c: Use vect_float_strict instead + of vect_float. + * gcc.dg/vect/vect-reduc-6.c: Likewise. + 2018-01-23 Richard Sandiford PR tree-optimization/83965 diff --git a/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c b/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c index 2445d605534..7a148e41d51 100644 --- a/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c +++ b/gcc/testsuite/gcc.dg/vect/no-fast-math-vect16.c @@ -1,4 +1,4 @@ -/* { dg-require-effective-target vect_float } */ +/* { dg-require-effective-target vect_float_strict } */ #include #include "tree-vect.h" diff --git a/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c b/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c index f80d5ba8114..ad148046a8e 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c +++ b/gcc/testsuite/gcc.dg/vect/vect-reduc-6.c @@ -1,4 +1,4 @@ -/* { dg-require-effective-target vect_float } */ +/* { dg-require-effective-target vect_float_strict } */ /* { dg-additional-options "-fno-fast-math" } */ #include diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 720914b0c4c..24514233cea 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -5492,7 +5492,8 @@ proc check_effective_target_vect_long { } { return $answer } -# Return 1 if the target supports hardware vectors of float, 0 otherwise. +# Return 1 if the target supports hardware vectors of float when +# -funsafe-math-optimizations is enabled, 0 otherwise. # # This won't change for different subtargets so cache the result. @@ -5525,6 +5526,14 @@ proc check_effective_target_vect_float { } { return $et_vect_float_saved($et_index) } +# Return 1 if the target supports hardware vectors of float without +# -funsafe-math-optimizations being enabled, 0 otherwise. + +proc check_effective_target_vect_float_strict { } { + return [expr { [check_effective_target_vect_float] + && ![istarget arm*-*-*] }] +} + # Return 1 if the target supports hardware vectors of double, 0 otherwise. # # This won't change for different subtargets so cache the result. -- 2.30.2