This adds the testcase from the PR.

Pushed.

2021-09-01  Richard Biener  <rguent...@suse.de>

        PR tree-optimization/102149
        * gcc.dg/torture/pr102149.c: New testcase.
---
 gcc/testsuite/gcc.dg/torture/pr102149.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/torture/pr102149.c

diff --git a/gcc/testsuite/gcc.dg/torture/pr102149.c 
b/gcc/testsuite/gcc.dg/torture/pr102149.c
new file mode 100644
index 00000000000..34a8c213133
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr102149.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-additional-options "-fno-vect-cost-model" } */
+
+int a[8];
+int *b = &a[6];
+char c;
+int main()
+{
+  int d = 7;
+  for (; d >= 0; d--)
+    {
+      *b = 1;
+      c = a[d] >> 3;
+      a[d] = c;
+    }
+  if (a[6] != 1)
+    __builtin_abort ();
+  return 0;
+}
-- 
2.31.1

Reply via email to