diff options
author | Richard Biener <rguenther@suse.de> | 2019-10-22 13:08:53 +0000 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2019-10-22 13:08:53 +0000 |
commit | d5124637ca3bb7df0decf4878b9f9b30502e7000 (patch) | |
tree | c20bf7b5f2e7182ea19563306405013ba0a1a803 /gcc/testsuite | |
parent | 87b5b79da8a95da55f2513dffd84c64e3eadcf5d (diff) |
2019-10-22 Richard Biener <rguenther@suse.de>
PR tree-optimization/92173
* tree-vect-loop.c (vectorizable_reduction): If
vect_transform_reduction cannot handle code-generation try without
the single-def-use-cycle optimization. Pass optab_vector to
optab_for_tree_code to get vector shifts as that's what we'd
generate.
* gcc.dg/torture/pr92173.c: New testcase.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@277288 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vshift-5.c | 44 |
2 files changed, 49 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9caf60787d4..0581b5f50c9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-22 Richard Biener <rguenther@suse.de> + + PR tree-optimization/92173 + * gcc.dg/torture/pr92173.c: New testcase. + 2019-10-22 Michael Matz <matz@suse.de> PR middle-end/90796 diff --git a/gcc/testsuite/gcc.dg/vshift-5.c b/gcc/testsuite/gcc.dg/vshift-5.c index daa5f1c5cd8..62e6328cb28 100644 --- a/gcc/testsuite/gcc.dg/vshift-5.c +++ b/gcc/testsuite/gcc.dg/vshift-5.c @@ -41,6 +41,42 @@ f2 (void) } __attribute__((noinline, noclone)) void +f2a (int x) +{ + long long a0, a1, a2, a3; + a0 = a[0]; + a1 = a[1]; + a2 = a[2]; + a3 = a[3]; + a0 = a0 << x; + a1 = a1 << 2; + a2 = a2 << 2; + a3 = a3 << 2; + a[0] = a0; + a[1] = a1; + a[2] = a2; + a[3] = a3; +} + +__attribute__((noinline, noclone)) void +f2b (int x) +{ + long long a0, a1, a2, a3; + a0 = a[0]; + a1 = a[1]; + a2 = a[2]; + a3 = a[3]; + a0 = a0 << 2; + a1 = a1 << 2; + a2 = a2 << x; + a3 = a3 << 2; + a[0] = a0; + a[1] = a1; + a[2] = a2; + a[3] = a3; +} + +__attribute__((noinline, noclone)) void f3 (int x) { long long a0, a1, a2, a3; @@ -77,5 +113,13 @@ main () if (a[0] != (4LL << 7) || a[1] != (3LL << 8) || a[2] != (2LL << 9) || a[3] != (1LL << 10)) abort (); + f2a (3); + if (a[0] != (4LL << 10) || a[1] != (3LL << 10) + || a[2] != (2LL << 11) || a[3] != (1LL << 12)) + abort (); + f2b (3); + if (a[0] != (4LL << 12) || a[1] != (3LL << 12) + || a[2] != (2LL << 14) || a[3] != (1LL << 14)) + abort (); return 0; } |