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
./:
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
gcc.dg
/
pr33136-1.c
1
/* PR tree-optimization/33136 */
2
/* { dg-do run } */
3
/* { dg-options "-O2" } */
4
5
extern void abort (void);
6
7
struct S
8
{
9
struct S *a;
10
int b;
11
float f;
12
};
13
14
static struct S s;
15
16
static int *
17
__attribute__((noinline, const))
18
foo (void)
19
{
20
return &s.b;
21
}
22
23
float
24
__attribute__((noinline))
25
bar (float *f)
26
{
27
s.f = 1.0;
28
*f = 4.0;
29
return s.f;
30
}
31
32
int
33
__attribute__((noinline))
34
baz (int *x)
35
{
36
s.b = 1;
37
*x = 4;
38
return s.b;
39
}
40
41
int
42
t (void)
43
{
44
float f = 8.0;
45
return bar (&f) + baz (foo ());
46
}
47
48
int
49
main (void)
50
{
51
if (t () != 5)
52
abort ();
53
return 0;
54
}