aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorliuhongt <hongtao.liu@intel.com>2023-07-20 12:44:03 +0800
committerliuhongt <hongtao.liu@intel.com>2023-07-21 10:38:17 +0800
commit629ad1cfdaf542c454536d56ba9de19bd0a4b046 (patch)
tree6840ab82654099eb902bac7c5c5f2cea54744528 /gcc
parenta4913a19d24a794c97f38d9c65c47c1fb9f2140c (diff)
downloadgcc-629ad1cfdaf542c454536d56ba9de19bd0a4b046.zip
gcc-629ad1cfdaf542c454536d56ba9de19bd0a4b046.tar.gz
gcc-629ad1cfdaf542c454536d56ba9de19bd0a4b046.tar.bz2
Fix fp16 related testcase failure for i686.
> I see some regressions most likely with this change on i686-linux, > in particular: > +FAIL: gcc.dg/pr107547.c (test for excess errors) > +FAIL: gcc.dg/torture/floatn-convert.c -O0 (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O0 compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O1 (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O1 compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O2 (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O2 compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O2 -flto (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O2 -flto compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O2 -flto -flto-partition=none (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O2 -flto -flto-partition=none compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O3 -g (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O3 -g compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -Os (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -Os compilation failed to produce executable > +FAIL: gcc.target/i386/float16-7.c (test for errors, line 7) > > Perhaps we need to tweak > gcc/testsuite/lib/target-supports.exp (add_options_for_float16) > so that it adds -msse2 for i?86-*-* x86_64-*-* (that would likely > fix up floatn-convert) and for the others perhaps > /* { dg-add-options float16 } */ > ? gcc/testsuite/ChangeLog: * gcc.dg/pr107547.c: Add { dg-add-options float16 }. * gcc.target/i386/float16-7.c: Add -msse2 to dg-options. * lib/target-supports.exp (add_options_for_float16): Add -msse2 for i?86-*-* || x86_64-*-*.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/pr107547.c1
-rw-r--r--gcc/testsuite/gcc.target/i386/float16-7.c2
-rw-r--r--gcc/testsuite/lib/target-supports.exp3
3 files changed, 5 insertions, 1 deletions
diff --git a/gcc/testsuite/gcc.dg/pr107547.c b/gcc/testsuite/gcc.dg/pr107547.c
index c6992c8..7cd68af 100644
--- a/gcc/testsuite/gcc.dg/pr107547.c
+++ b/gcc/testsuite/gcc.dg/pr107547.c
@@ -1,6 +1,7 @@
/* PR tree-optimization/107547 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-add-options float16 } */
int x;
diff --git a/gcc/testsuite/gcc.target/i386/float16-7.c b/gcc/testsuite/gcc.target/i386/float16-7.c
index 86641af..660021b 100644
--- a/gcc/testsuite/gcc.target/i386/float16-7.c
+++ b/gcc/testsuite/gcc.target/i386/float16-7.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=16" } */
+/* { dg-options "-O2 -msse2 -mfpmath=387 -fexcess-precision=16" } */
/* { dg-excess-errors "'-fexcess-precision=16' is not compatible with '-mfpmath=387'" } */
_Float16
foo (_Float16 a, _Float16 b)
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 8ea0d9f..4202447 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -3487,6 +3487,9 @@ proc add_options_for_float16 { flags } {
if { [istarget arm*-*-*] } {
return "$flags -mfp16-format=ieee"
}
+ if { [istarget i?86-*-*] || [istarget x86_64-*-*] } {
+ return "$flags -msse2"
+ }
return "$flags"
}