summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr46177.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr46177.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr46177.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr46177.c b/gcc/testsuite/gcc.dg/pr46177.c
new file mode 100644
index 000000000..397e31634
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr46177.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-copy-prop -ftree-loop-distribution" } */
+
+extern int A[];
+extern int B[];
+
+void
+foo (int j, int c)
+{
+ int i;
+
+ if (c)
+ for (i = 0; i < j; i++)
+ A[i] = B[i] = 0;
+
+ for (i = 0; i < j; i++)
+ A[i] = B[i];
+}