OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [pr16808.c] - Blame information for rev 297

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* 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
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.