Tighten condition in vect/pr85586.c (PR 85654)
[official-gcc.git] / gcc / testsuite / gcc.dg / loop-8.c
blob842c0e773b24343c14648cc5f2acbae2c5b9e8ff
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fdump-rtl-loop2_invariant" } */
3 /* { dg-skip-if "unexpected IV" { "hppa*-*-* mips*-*-* visium-*-* powerpc*-*-* riscv*-*-*" } } */
5 void
6 f (int *a, int *b)
8 int i;
10 for (i = 0; i < 100; i++)
12 int d = 42;
14 a[i] = d;
15 if (i % 2)
16 d = i;
17 b[i] = d;
21 /* Load of 42 is moved out of the loop, introducing a new pseudo register. */
22 /* { dg-final { scan-rtl-dump-times "Decided" 1 "loop2_invariant" } } */
23 /* { dg-final { scan-rtl-dump-not "without introducing a new temporary register" "loop2_invariant" } } */