1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized -fno-strict-aliasing" } */
3 /* Test with fixed address */
4 static int *foo =  (int *) (unsigned long) 0x7800000;
5 
6 int func(void) __attribute__ ((noinline));
7 
8 extern int bar(void);
9 
func(void)10 int func(void)
11 {
12    if (*foo) {
13       return 1;
14    }
15    return 0;
16 
17 }
18 
foobar(void)19 int foobar(void)
20 {
21 
22    if (func()) {
23       *foo = 1;
24    }
25    return func();
26 }
27 
28 /* { dg-final { scan-tree-dump-times "= func" 2 "optimized" } } */
29