]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[committed] Fix compromised ARC test
authorJeff Law <jlaw@ventanamicro.com>
Fri, 6 Jun 2025 14:45:53 +0000 (08:45 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 6 Jun 2025 14:45:53 +0000 (08:45 -0600)
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.

gcc/testsuite/gcc.target/arc/fma-1.c

index c195ad98127c18779cfcee6db834e6e4a2db2f48..b32989fced1ba180c9c083216dae82447d0312b1 100644 (file)
@@ -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.  */