aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2023-04-03 09:57:07 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2023-04-03 09:57:07 +0100
commit65216cd44b8c89640ad987b6227ea1d748456a41 (patch)
treefbeb5ccf6df9c091c2210cf5c72c63b929e4c51b /gcc/testsuite/gcc.target
parentcaecd24e230c4727c88ad117bab0342f378e81f7 (diff)
downloadgcc-65216cd44b8c89640ad987b6227ea1d748456a41.zip
gcc-65216cd44b8c89640ad987b6227ea1d748456a41.tar.gz
gcc-65216cd44b8c89640ad987b6227ea1d748456a41.tar.bz2
vect: Fix single def-use cycle for ifn reductions [PR108608]
The patch that added support for fmin/fmax reductions didn't handle single def-use cycles. In some ways, this seems like going out of our way to make things slower, but that's a discussion for another day. gcc/ PR tree-optimization/108608 * tree-vect-loop.cc (vect_transform_reduction): Handle single def-use cycles that involve function calls rather than tree codes. gcc/testsuite/ PR tree-optimization/108608 * gcc.dg/vect/pr108608.c: New test. * gcc.target/aarch64/sve/pr108608-1.c: Likewise. (cherry picked from commit 2bb444787ed17a9e786f544cdf51ee2ac6779ab2)
Diffstat (limited to 'gcc/testsuite/gcc.target')
-rw-r--r--gcc/testsuite/gcc.target/aarch64/sve/pr108608-1.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/aarch64/sve/pr108608-1.c b/gcc/testsuite/gcc.target/aarch64/sve/pr108608-1.c
new file mode 100644
index 0000000..0a7d485
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/sve/pr108608-1.c
@@ -0,0 +1,9 @@
+/* { dg-options "-O3" } */
+
+double __attribute__((noipa))
+foo (double m, float *ptr)
+{
+ for (int i = 0; i < 256; i++)
+ m = __builtin_fmax (m, ptr[i]);
+ return m;
+}