blob: 7780fa6fcd65e146b82b6ff116d2f57624986b33 [file] [log] [blame]
/* { dg-do compile } */
/* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */
extern int flag;
int foo() {
int x;
int y = 9;
float* q;
float* r;
if (flag) {
q = (float*) &x; /* { dg-warning "type-punn" } */
} else {
q = (float*) &y; /* { dg-warning "type-punn" } */
}
*q = 1.0;
return x;
}