[PR117704] testsuite: Fix test failure on x86_32 by adding -mfpmath=sse+387

Message ID 608E2A0E-911B-4F91-BC55-49D68A3A18F7@nvidia.com
State New
Headers
Series [PR117704] testsuite: Fix test failure on x86_32 by adding -mfpmath=sse+387 |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-aarch64 success Test passed
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_check--master-arm success Test passed

Commit Message

Jennifer Schmitz Nov. 28, 2024, 11:20 a.m. UTC
  The test gcc.dg/tree-ssa/pow_fold_1.c was failing for 32-bit x86 due to
incompatibility of '-fexcess-precision=16' with '-mfpmath=387'.
In order to resolve this, this patch adds -msse -mfpmath=sse+387 for i?86-*-*.

We tested this by running the test on an x86_64 machine with
--target_board={unix/-m32}.
OK for mainline?

Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>

gcc/testsuite/
	PR testsuite/117704
	* gcc.dg/tree-ssa/pow_fold_1.c: Add -msse -mfpmath=sse+387
	for i?86-*-*.
---
 gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c | 1 +
 1 file changed, 1 insertion(+)

--
  

Comments

Jakub Jelinek Nov. 28, 2024, 11:27 a.m. UTC | #1
On Thu, Nov 28, 2024 at 11:20:31AM +0000, Jennifer Schmitz wrote:
> The test gcc.dg/tree-ssa/pow_fold_1.c was failing for 32-bit x86 due to
> incompatibility of '-fexcess-precision=16' with '-mfpmath=387'.
> In order to resolve this, this patch adds -msse -mfpmath=sse+387 for i?86-*-*.
> 
> We tested this by running the test on an x86_64 machine with
> --target_board={unix/-m32}.
> OK for mainline?
> 
> Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
> 
> gcc/testsuite/
> 	PR testsuite/117704
> 	* gcc.dg/tree-ssa/pow_fold_1.c: Add -msse -mfpmath=sse+387
> 	for i?86-*-*.
> ---
>  gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c b/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
> index d98bcb0827e..cb9d52e9653 100644
> --- a/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-Ofast -fdump-tree-optimized -fexcess-precision=16" } */
>  /* { dg-add-options float16 } */
> +/* { dg-additional-options "-msse -mfpmath=sse+387" { target { i?86-*-* } } } */

i?86-*-* shouldn't be used in target selectors alone, it doesn't mean much.
One can also use -m32 on x86_64-*-*, or i?86-*-* can be multilib compiler.
So, either it should be i?86-*-* x86_64-*-* or if one wants to limit it just
to 32-bit compilation on that target (but why in this case?), then
ia32 or { i?86-*-* x86_64-*-* } && ia32 etc.

>  /* { dg-require-effective-target float16_runtime } */
>  /* { dg-require-effective-target c99_runtime } */

	Jakub
  
Uros Bizjak Nov. 28, 2024, 12:58 p.m. UTC | #2
On Thu, Nov 28, 2024 at 12:22 PM Jennifer Schmitz <jschmitz@nvidia.com> wrote:
>
> The test gcc.dg/tree-ssa/pow_fold_1.c was failing for 32-bit x86 due to
> incompatibility of '-fexcess-precision=16' with '-mfpmath=387'.
> In order to resolve this, this patch adds -msse -mfpmath=sse+387 for i?86-*-*.

This is already fixed by [1] that adds missing -mpfpmath=sse to
add_options_for_float16 dejagnu procedure.

[1] https://gcc.gnu.org/pipermail/gcc-patches/2024-November/669910.html

Uros.

>
> We tested this by running the test on an x86_64 machine with
> --target_board={unix/-m32}.
> OK for mainline?
>
> Signed-off-by: Jennifer Schmitz <jschmitz@nvidia.com>
>
> gcc/testsuite/
>         PR testsuite/117704
>         * gcc.dg/tree-ssa/pow_fold_1.c: Add -msse -mfpmath=sse+387
>         for i?86-*-*.
> ---
>  gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c b/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
> index d98bcb0827e..cb9d52e9653 100644
> --- a/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
> +++ b/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
> @@ -1,6 +1,7 @@
>  /* { dg-do compile } */
>  /* { dg-options "-Ofast -fdump-tree-optimized -fexcess-precision=16" } */
>  /* { dg-add-options float16 } */
> +/* { dg-additional-options "-msse -mfpmath=sse+387" { target { i?86-*-* } } } */
>  /* { dg-require-effective-target float16_runtime } */
>  /* { dg-require-effective-target c99_runtime } */
>
> --
  

Patch

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c b/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
index d98bcb0827e..cb9d52e9653 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pow_fold_1.c
@@ -1,6 +1,7 @@ 
 /* { dg-do compile } */
 /* { dg-options "-Ofast -fdump-tree-optimized -fexcess-precision=16" } */
 /* { dg-add-options float16 } */
+/* { dg-additional-options "-msse -mfpmath=sse+387" { target { i?86-*-* } } } */
 /* { dg-require-effective-target float16_runtime } */
 /* { dg-require-effective-target c99_runtime } */