From: Richard Biener Date: Fri, 30 Apr 2021 09:13:42 +0000 (+0200) Subject: tree-optimization/96513 - add testcase for fixed bug X-Git-Tag: releases/gcc-11.2.0~468 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5aa0e1416d9a9704e4846ca2ae722403684fec8;p=thirdparty%2Fgcc.git 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 PR tree-optimization/96513 * gcc.dg/torture/pr96513.c: New testcase. --- diff --git a/gcc/testsuite/gcc.dg/torture/pr96513.c b/gcc/testsuite/gcc.dg/torture/pr96513.c new file mode 100644 index 000000000000..5ee040e96c8e --- /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); +}