repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR middle-end/27945
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
Wstrict-aliasing-float-ptr-int-obj.c
blob
7780fa6fcd65e146b82b6ff116d2f57624986b33
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" } */
15
}
else
{
16
q
= (
float
*) &
y
;
/* { dg-warning "type-punn" } */
17
}
18
19
*
q
=
1.0
;
20
21
return
x
;
22
23
}