diff options
author | Richard Biener <rguenther@suse.de> | 2019-10-22 13:08:53 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2019-10-22 13:08:53 +0000 |
commit | 6c7b0df8029d01e05577668333660d0bc58a3023 (patch) | |
tree | c20bf7b5f2e7182ea19563306405013ba0a1a803 /gcc/testsuite | |
parent | 92781ff1da896b2f92b1dcc06953be493371bf21 (diff) | |
download | gcc-6c7b0df8029d01e05577668333660d0bc58a3023.zip gcc-6c7b0df8029d01e05577668333660d0bc58a3023.tar.gz gcc-6c7b0df8029d01e05577668333660d0bc58a3023.tar.bz2 |
re PR tree-optimization/92173 (ICE in optab_for_tree_code, at optabs-tree.c:81)
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.
From-SVN: r277288
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 9caf607..0581b5f 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 daa5f1c..62e6328 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; } |