]> gcc.gnu.org Git - gcc.git/commitdiff
tree-optimization/112585 - new testcase
authorRichard Biener <rguenther@suse.de>
Fri, 17 Nov 2023 13:49:06 +0000 (14:49 +0100)
committerRichard Biener <rguenther@suse.de>
Fri, 17 Nov 2023 13:52:17 +0000 (14:52 +0100)
The offending commit r14-5444-g5ea2965b499f9e was reverted.  The
following adds a testcase.

PR tree-optimization/112585
* gcc.dg/torture/pr112585.c: New testcase.

gcc/testsuite/gcc.dg/torture/pr112585.c [new file with mode: 0644]

diff --git a/gcc/testsuite/gcc.dg/torture/pr112585.c b/gcc/testsuite/gcc.dg/torture/pr112585.c
new file mode 100644 (file)
index 0000000..6c8cbeb
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-additional-options "-ftree-loop-distribution" } */
+
+static int a[10], b;
+char c, *d = &c, e;
+int main()
+{
+  int f = 0;
+  for (; f < 9; f++) {
+    a[f] = 1;
+    a[f + 1] = e;
+    for (b = 0; b < 8; b++)
+      *d = 0;
+  }
+  if (a[2] != 1)
+    __builtin_abort();
+  return 0;
+}
This page took 0.07605 seconds and 5 git commands to generate.