diff options
author | Joseph Myers <joseph@codesourcery.com> | 2018-09-28 16:45:51 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2018-09-28 16:45:51 +0100 |
commit | 5718d9d95fd9457c9f6cf49526ef52f974d9419c (patch) | |
tree | a880fc39f7bad1c3b55e0f5003ad2450d27341e2 /gcc | |
parent | 02469d3a1d3bdd234ec3832c4a26853586c75f2a (diff) | |
download | gcc-5718d9d95fd9457c9f6cf49526ef52f974d9419c.zip gcc-5718d9d95fd9457c9f6cf49526ef52f974d9419c.tar.gz gcc-5718d9d95fd9457c9f6cf49526ef52f974d9419c.tar.bz2 |
Fix gcc.dg/torture/fp-int-convert.h for excess precision after PR c/87390.
As reported in
<https://gcc.gnu.org/ml/gcc-patches/2018-09/msg01684.html>, some
fp-int-convert tests fail after my fix for PR c/87390, in Arm /
AArch64 configurations where _Float16 uses excess precision by
default. The issue is comparisons of the results of a conversion by
assignment (compile-time or run-time) from integer to floating-point
with the original integer value; previously this would compare against
an implicit compile-time conversion to the target type, but now, for
C11 and later, it compares against an implicit compile-time conversion
to a possibly wider evaluation format. This is fixed by adding casts
to the test so that the comparison is with a value converted
explicitly to the target type at compile time, without any use of a
wider evaluation format.
PR c/87390
* gcc.dg/torture/fp-int-convert.h (TEST_I_F_VAL): Convert integer
values explicitly to target type for comparison.
From-SVN: r264696
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/fp-int-convert.h | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7e67962..ff242d8 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2018-09-28 Joseph Myers <joseph@codesourcery.com> + + PR c/87390 + * gcc.dg/torture/fp-int-convert.h (TEST_I_F_VAL): Convert integer + values explicitly to target type for comparison. + 2018-09-28 Steve Ellcey <sellcey@cavium.com> PR testsuite/87433 diff --git a/gcc/testsuite/gcc.dg/torture/fp-int-convert.h b/gcc/testsuite/gcc.dg/torture/fp-int-convert.h index 2b904b6..f0b3f39 100644 --- a/gcc/testsuite/gcc.dg/torture/fp-int-convert.h +++ b/gcc/testsuite/gcc.dg/torture/fp-int-convert.h @@ -90,6 +90,7 @@ do { \ if (ivin != (VAL) \ || ((PREC_OK) && ivout != ivin) \ || ((PREC_OK) && ivout != (VAL)) \ - || fv1 != (VAL) || fv2 != (VAL) || fv1 != fv2) \ + || fv1 != (FT) (VAL) || fv2 != (FT) (VAL) \ + || fv1 != fv2) \ abort (); \ } while (0) |