aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr45472.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr45472.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr45472.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr45472.c b/gcc/testsuite/gcc.dg/pr45472.c
new file mode 100644
index 0000000..573e83d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr45472.c
@@ -0,0 +1,21 @@
+/* { dg-do compile { target powerpc*-*-* ia64-*-* x86_64-*-* } } */
+/* { dg-options "-O -fschedule-insns2 -fselective-scheduling2" } */
+
+struct S
+{
+ volatile long vl;
+ int i;
+};
+struct S s1, s2;
+
+void
+foo (int j, int c)
+{
+ int i;
+ for (i = 0; i <= j; i++)
+ {
+ if (c)
+ s2.vl += s1.vl;
+ s1 = s2;
+ }
+}