OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / compile / pr16808.c
1 /* We used to ICE as we did not mark a Vop for rename as
2    we changed a function call to a normal modify statement
3    while folding exp(0.0); */
4
5 double exp(double);
6 void f0(void);
7 void f(double);
8 typedef struct Parser {
9     int x;
10     char *s;
11 } Parser;
12 static double pop(Parser *p) {
13     if (p->s[0] <= 0) {
14         f0();
15         return 0;
16     }
17     --p->x;
18     return 0;
19 }
20 static void evalFactor(Parser *p) {
21     while (p->x)
22         f(exp(pop(p)));
23 }
24 static void evalTerm(Parser *p) {
25     while (p->s[0])
26         evalFactor(p);
27 }
28 static void evalExpression(Parser *p) {
29     evalTerm(p);
30     while (p->s[0])
31         evalTerm(p);
32 }
33 void evalPrimary(Parser *p) {
34     if (p->s)
35         return;
36     evalExpression(p);
37 }
38