When using the 387 FPU, we don't perform the expected optimization of
unions to floats. Setting -fexcess-precision=standard. doesn't fix it
for x86, but selecting -mfpmath=sse and forcing sse enabled does.
Regstrapped on x86_64-linux-gnu. Also tested with ppc-vx7r2,
ppc64-vx7r2, arm-vx7r2, aarch64-vx7r2, x86_64-vx7r2, and x86-vx7r2. Ok
to install?
for gcc/testsuite/ChangeLog
* gcc.dg/tree-ssa/pr32964.c: Select the SSE FPU on x86.
---
gcc/testsuite/gcc.dg/tree-ssa/pr32964.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c
b/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c
index 3d587119de90f..1c3baa62b98cd 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr32964.c
@@ -1,5 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-O1 -fdump-tree-optimized" } */
+/* We don't get the expected optimization any more when x87's excess precision
+ is available. */
+/* { dg-additional-options "-msse -mfpmath=sse" { target x86 } } */
union A
{
--
Alexandre Oliva, happy hacker https://blog.lx.oliva.nom.br/
Free Software Activist FSFLA co-founder GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!