Message ID | 20230720045009.989895-1-hongtao.liu@intel.com |
---|---|
State | New |
Headers | show |
Series | Fix fp16 related testcase failure for i686. | expand |
diff --git a/gcc/testsuite/gcc.dg/pr107547.c b/gcc/testsuite/gcc.dg/pr107547.c index c6992c8674b..7cd68afc0af 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 86641afeba9..660021b6ccc 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 8ea0d9feb1c..42024474091 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" }