tree-optimization/112585 - new testcase

Message ID 20231117135055.F1BFF1341F@imap2.suse-dmz.suse.de
State Accepted
Headers
Series tree-optimization/112585 - new testcase |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Richard Biener Nov. 17, 2023, 1:50 p.m. UTC
  The offending commit r14-5444-g5ea2965b499f9e was reverted.  The
following adds a testcase.

Pushed.

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

Patch

diff --git a/gcc/testsuite/gcc.dg/torture/pr112585.c b/gcc/testsuite/gcc.dg/torture/pr112585.c
new file mode 100644
index 00000000000..6c8cbeba3c2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr112585.c
@@ -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;
+}