re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / loop-9.c
1 /* Without TARGET_MEM_REFs, dom creates code like
2
3 i1 = 4 * i;
4 *(p + i1) = i;
5 *(p + i1 + 4) = i
6
7 causing us to have unnecessary multiplication by 4 in the
8 result. */
9
10 /* { dg-do compile } */
11 /* { dg-options "-O1" } */
12
13 void foo (int *p)
14 {
15 int i;
16
17 for (i = 0; i < 100; i++)
18 {
19 p[i] = i;
20 p[i + 1] = i;
21 }
22 }
23
24 /* { dg-final { scan-assembler-times "lea\\t" 0 { target i?86-*-* x86_64-*-* } } } */