Jakub's recent changes for pr120231 compromised this arc port specific
test. Essentially we collapse the entire FMA sequence down to a
constant and thus never emit the FMA instruction the test wants to see.
If we make "a" an extern so that we don't know its value the optimizers
can't collapse the calculation away completely and we can verify that we
get an FMA operation.
Pushing to the trunk.
Jeff
commit e37eb8578c5c9a62d4f804908ad57fc38c71a3a2
Author: Jeff Law <j...@ventanamicro.com>
Date: Fri Jun 6 08:45:53 2025 -0600
[committed] Fix compromised ARC test
Jakub's recent changes for pr120231 compromised this arc port specific test.
Essentially we collapse the entire FMA sequence down to a constant and thus
never emit the FMA instruction the test wants to see.
If we make "a" an extern so that we don't know its value the optimizers
can't
collapse the calculation away completely and we can verify that we get an
FMA
operation.
Pushing to the trunk.
gcc/testsuite
* gcc.target/arc/fma-1.c: Make "a" extern so the optimizers can
see any value and optimize away the key computation.
diff --git a/gcc/testsuite/gcc.target/arc/fma-1.c
b/gcc/testsuite/gcc.target/arc/fma-1.c
index c195ad98127..b32989fced1 100644
--- a/gcc/testsuite/gcc.target/arc/fma-1.c
+++ b/gcc/testsuite/gcc.target/arc/fma-1.c
@@ -2,7 +2,8 @@
/* { dg-skip-if "FPU not available" { arc700 || arc6xx } } */
/* { dg-options "-s -std=gnu11 -O2 -frounding-math -mfpu=fpus_all" } */
-const float a, b = 7.8539818525e01;
+const float b = 7.8539818525e01;
+extern const float a;
/* Check if the fma operation is generated correctly. */