From 04abafe9831f6867af1211ecae853ff373235b2d Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Fri, 17 Nov 2023 14:49:06 +0100 Subject: [PATCH] tree-optimization/112585 - new testcase 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 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr112585.c diff --git a/gcc/testsuite/gcc.dg/torture/pr112585.c b/gcc/testsuite/gcc.dg/torture/pr112585.c new file mode 100644 index 000000000000..6c8cbeba3c2e --- /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; +} -- 2.47.2