OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
PR middle-end/36509
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
gcc.dg
/
Wstrict-aliasing-float-ptr-int-obj.c
1
/* { dg-do compile } */
2
/* { dg-options "-O -Wstrict-aliasing -fstrict-aliasing" } */
3
4
extern int flag;
5
6
int foo() {
7
8
int x;
9
int y = 9;
10
float* q;
11
float* r;
12
13
if (flag) {
14
q = (float*) &x; /* { dg-warning "type-punn" "" { xfail *-*-* } } */
15
} else {
16
q = (float*) &y; /* { dg-warning "type-punn" "" { xfail *-*-* } } */
17
}
18
19
*q = 1.0;
20
21
return x;
22
23
}