re PR tree-optimization/33291 (a+=2; a+=2 not simplified to a+=4; with -O3 ...
[gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20030807-10.c
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-vrp1" } */
3
4
5 extern const unsigned char mode_size[];
6 unsigned int
7 subreg_highpart_offset (outermode, innermode)
8 int outermode, innermode;
9 {
10 unsigned int offset = 0;
11 int difference = (mode_size[innermode] - mode_size[outermode]);
12 if (difference > 0)
13 {
14 offset += difference % (0 ? 8 : 4);
15 offset += difference / 4 * 4;
16 }
17 return offset;
18 }
19
20 /* There should be one mask with the value 3. */
21 /* { dg-final { scan-tree-dump-times " \& 3" 1 "vrp1"} } */
22
23 /* There should be one right shift by 2 places. */
24 /* { dg-final { scan-tree-dump-times " >> 2" 1 "vrp1"} } */
25
26 /* { dg-final { cleanup-tree-dump "vrp1" } } */