PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / Wstrict-aliasing-float-ptr-int-obj.c
blobb90fb76c28bcb98d38a88c57e72914ea4c85e8fb
1 /* { dg-do compile } */
2 /* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */
4 extern int flag;
6 int foo() {
8 int x;
9 int y = 9;
10 float* q;
11 float* r;
13 if (flag) {
14 q = (float*) &x; /* { dg-message "initialized" "" { xfail *-*-* } } */
15 } else {
16 q = (float*) &y; /* { dg-message "initialized" "" { xfail *-*-* } } */
19 *q = 1.0; /* { dg-warning "does break strict-aliasing" "" { xfail *-*-* } } */
21 return x;