]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix compile options of pr110279-1.c and pr110279-2.c
authorDi Zhao <dizhao@os.amperecomputing.com>
Tue, 26 Dec 2023 08:36:02 +0000 (16:36 +0800)
committerDi Zhao <dizhao@os.amperecomputing.com>
Tue, 26 Dec 2023 08:38:21 +0000 (16:38 +0800)
The two testcases are for targets that support FMA. And
pr110279-2.c assumes reassoc_width of FMUL to be 4.

This patch adds missing options, to fix regression test failures
on nvptx/GCN (default reassoc_width of FMUL is 1) and x86_64
(need "-mfma").

gcc/testsuite/ChangeLog:

* gcc.dg/pr110279-1.c: Add "-mcpu=generic" for aarch64; add
"-mfma" for x86_64.
* gcc.dg/pr110279-2.c: Replace "-march=armv8.2-a" with
"-mcpu=generic"; limit the check to be on aarch64.

gcc/testsuite/gcc.dg/pr110279-1.c
gcc/testsuite/gcc.dg/pr110279-2.c

index a62acb734c6eeb200ef837b6218eb9b8b874444e..a8c7257b28d320bab9249147fe854d1df3b03972 100644 (file)
@@ -1,6 +1,7 @@
 /* { dg-do compile } */
 /* { dg-options "-Ofast --param avoid-fma-max-bits=512 --param tree-reassoc-width=4 -fdump-tree-widening_mul-details" } */
-/* { dg-additional-options "-march=armv8.2-a" { target aarch64-*-* } } */
+/* { dg-additional-options "-mcpu=generic" { target aarch64*-*-* } } */
+/* { dg-additional-options "-mfma" { target i?86-*-* x86_64-*-* } } */
 /* { dg-additional-options "-march=2.0" { target hppa*-*-* } } */
 
 #define LOOP_COUNT 800000000
index b6b69969c6b7ac7ecf7acf58cbfc5502ef16243c..135e64882d12fe351a3325b88740de58ea7c77e3 100644 (file)
@@ -1,7 +1,7 @@
 /* PR tree-optimization/110279 */
 /* { dg-do compile } */
 /* { dg-options "-Ofast --param tree-reassoc-width=4 --param fully-pipelined-fma=1 -fdump-tree-reassoc2-details -fdump-tree-optimized" } */
-/* { dg-additional-options "-march=armv8.2-a" { target aarch64-*-* } } */
+/* { dg-additional-options "-mcpu=generic" { target aarch64*-*-* } } */
 
 #define LOOP_COUNT 800000000
 typedef double data_e;
@@ -35,5 +35,5 @@ foo (data_e in)
   return result + result2;
 }
 
-/* { dg-final { scan-tree-dump-not "was chosen for reassociation" "reassoc2"} } */
-/* { dg-final { scan-tree-dump-times {\.FMA } 3 "optimized"} } */
\ No newline at end of file
+/* { dg-final { scan-tree-dump-not "was chosen for reassociation" "reassoc2" { target aarch64*-*-* }} } */
+/* { dg-final { scan-tree-dump-times {\.FMA } 3 "optimized" { target aarch64*-*-* }} } */
\ No newline at end of file