Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / tree-ssa / vrp14.c
blob833a73dcadc3d5ea55884031b1235d3fa6b12934
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 struct tree_decl
6 union tree_decl_u1 {
7 int f;
8 long i;
9 struct tree_decl_u1_a {
10 unsigned int align : 24;
11 unsigned int off_align : 8;
12 } a;
13 } u1;
16 extern void abort (void);
18 unsigned int
19 assemble_variable (struct tree_decl decl)
21 unsigned int align;
23 align = decl.u1.a.align;
25 if (align > (1 << ((8 * 4) < 64 ? (8 * 4) - 2 : 62)))
26 align = (1 << ((8 * 4) < 64 ? (8 * 4) - 2 : 62));
28 /* VRP should not be propagating 0 to the RHS of this assignment.
29 But it was erroneously applying a cast operation between types of
30 different precision. align is an unsigned int with range [0,
31 0x4000000] but the .align field holds only 24 bits. So the cast
32 was returning a [0, 0] range. */
33 decl.u1.a.align = align;
35 return decl.u1.a.align;
38 main ()
40 struct tree_decl decl;
41 decl.u1.a.align = 13;
42 unsigned int x = assemble_variable (decl);
43 if (x == 0)
44 abort ();
45 return 0;