1 /* PR c/90737 - inconsistent address of a local converted to intptr_t
2 between callee and caller
4 { dg-options "-O1 -Wall -Wreturn-local-addr -fdump-tree-optimized" } */
6 typedef __INTPTR_TYPE__
intptr_t;
9 return_addr_local_as_int (void)
12 if ((intptr_t)&i
== 0)
18 void get_addr_local_as_int (void)
20 intptr_t i
= return_addr_local_as_int ();
26 static inline intptr_t
27 return_addr_label_as_int (void)
30 if ((intptr_t)&&label
== 0)
33 return (intptr_t)&&label
;
36 void get_addr_label_as_int (void)
38 intptr_t i
= return_addr_label_as_int ();
43 /* Verify that the functions that return the address of the label
44 or local variable have been optimized away and so have the calls
46 { dg-final { scan-tree-dump-not "return_addr_" "optimized" } }
47 { dg-final { scan-tree-dump-not "abort" "optimized" } } */