From: Di Zhao Date: Tue, 26 Dec 2023 08:36:02 +0000 (+0800) Subject: Fix compile options of pr110279-1.c and pr110279-2.c X-Git-Tag: basepoints/gcc-15~3304 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6cec7b06b3c8187b36fc05cfd4dd38b42313d727;p=thirdparty%2Fgcc.git Fix compile options of pr110279-1.c and pr110279-2.c 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. --- diff --git a/gcc/testsuite/gcc.dg/pr110279-1.c b/gcc/testsuite/gcc.dg/pr110279-1.c index a62acb734c6e..a8c7257b28d3 100644 --- a/gcc/testsuite/gcc.dg/pr110279-1.c +++ b/gcc/testsuite/gcc.dg/pr110279-1.c @@ -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 diff --git a/gcc/testsuite/gcc.dg/pr110279-2.c b/gcc/testsuite/gcc.dg/pr110279-2.c index b6b69969c6b7..135e64882d12 100644 --- a/gcc/testsuite/gcc.dg/pr110279-2.c +++ b/gcc/testsuite/gcc.dg/pr110279-2.c @@ -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