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 tree-optimization/33562
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.dg
/
tree-ssa
/
ssa-ccp-12.c
blob
42e3a2edb517b8cf6a64e636c87929e942dad35e
1
/* { dg-do run } */
2
/* { dg-options "-O2" } */
3
4
void
link_error
(
void
);
5
6
struct
A
7
{
8
int
a
;
9
int
b
;
10
};
11
12
struct
A a
;
13
const int
B
=
42
;
14
15
void
foo
(
int
i
)
16
{
17
if
(
i
>
10
)
18
a
.
a
=
42
;
19
else
20
{
21
a
.
b
=
21
;
22
a
.
a
=
a
.
b
+
21
;
23
}
24
25
/* This should be folded to 'if (0)' as a.a and B are both 42. */
26
if
(
a
.
a
!=
B
)
27
link_error
();
28
}
29
30
int
31
main
()
32
{
33
foo
(
3
);
34
return
0
;
35
}