aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-04-30 11:13:42 +0200
committerRichard Biener <rguenther@suse.de>2021-04-30 11:15:13 +0200
commitb9bc4467cc78201f362b5390d53640b0feaa8d40 (patch)
tree5aaea2c53e77d020b0d9e4d77b77f3f296a3ce32 /gcc
parentc111f6066043d3b7bc4141ca0411eae9294aa6c5 (diff)
downloadgcc-b9bc4467cc78201f362b5390d53640b0feaa8d40.zip
gcc-b9bc4467cc78201f362b5390d53640b0feaa8d40.tar.gz
gcc-b9bc4467cc78201f362b5390d53640b0feaa8d40.tar.bz2
tree-optimization/96513 - add testcase for fixed bug
This adds a testcase for a bug that was fixed with the hybrid SLP detection rewrite. 2021-04-30 Richard Biener <rguenther@suse.de> PR tree-optimization/96513 * gcc.dg/torture/pr96513.c: New testcase.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr96513.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr96513.c b/gcc/testsuite/gcc.dg/torture/pr96513.c
new file mode 100644
index 0000000..5ee040e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr96513.c
@@ -0,0 +1,26 @@
+/* { dg-do compile } */
+
+typedef struct {
+ short a;
+ short b;
+} c;
+c *d;
+int e, f, i, j, k, l, m, n, o, p;
+c g, h;
+void q() {
+ do {
+ if (o) {
+ (*d).a = (*d).b = d[e].a = d[e].a * 3 + 1 >> 15;
+ d[e].b = d[e].b * 3 + 1 >> 15;
+ }
+ n = -(d[e].b * g.b) >> 5;
+ m = d[e].b * g.a + 1 >> 5;
+ l = d[f].a * -d[f].b * h.b + 1 >> 5;
+ k = d[f].a * h.b + d[f].b * h.a + 1 >> 5;
+ j = n + l;
+ i = m - k;
+ (*d).a += j;
+ d[e].a -= i;
+ ++d;
+ } while (--p);
+}