PR testsuite/52641
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / 20050719-1.c
blob8dc4c7e5be7bed89e9de3755cb8d3cf6e9ecb731
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
4 extern void abort (void) __attribute__ ((__nothrow__)) __attribute__
5 ((__noreturn__));
6 extern void exit (int __status) __attribute__ ((__nothrow__))
7 __attribute__ ((__noreturn__));
9 struct bootLoader {
10 int x;
13 void
14 zap(struct bootLoader *bootLoader)
16 /* The expression on the RHS of the assignment is *not* a
17 dereference of pointer 'bootLoader'. It is merely used as an
18 offset calculation. VRP was erroneously removing the if()
19 because it thought that 'bootLoader' was always dereferenced. */
20 int *boot = &bootLoader->x;
22 if (bootLoader)
24 useboot (boot);
28 int
29 useboot (void *boot)
31 abort ();
34 main()
36 zap (0);
37 return 0;