OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr49886.c] - Blame information for rev 711

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
struct PMC {
2
    unsigned flags;
3
};
4
 
5
typedef struct Pcc_cell
6
{
7
    struct PMC *p;
8
    long bla;
9
    long type;
10
} Pcc_cell;
11
 
12
int gi;
13
int cond;
14
 
15
extern void abort ();
16
extern void never_ever(int interp, struct PMC *pmc)
17
  __attribute__((noinline,noclone));
18
 
19
void never_ever (int interp, struct PMC *pmc)
20
{
21
  abort ();
22
}
23
 
24
static void mark_cell(int * interp, Pcc_cell *c)
25
  __attribute__((__nonnull__(1)));
26
 
27
static void
28
mark_cell(int * interp, Pcc_cell *c)
29
{
30
  if (!cond)
31
    return;
32
 
33
  if (c && c->type == 4 && c->p
34
      && !(c->p->flags & (1<<18)))
35
    never_ever(gi + 1, c->p);
36
  if (c && c->type == 4 && c->p
37
      && !(c->p->flags & (1<<17)))
38
    never_ever(gi + 2, c->p);
39
  if (c && c->type == 4 && c->p
40
      && !(c->p->flags & (1<<16)))
41
    never_ever(gi + 3, c->p);
42
  if (c && c->type == 4 && c->p
43
      && !(c->p->flags & (1<<15)))
44
    never_ever(gi + 4, c->p);
45
  if (c && c->type == 4 && c->p
46
      && !(c->p->flags & (1<<14)))
47
    never_ever(gi + 5, c->p);
48
  if (c && c->type == 4 && c->p
49
      && !(c->p->flags & (1<<13)))
50
    never_ever(gi + 6, c->p);
51
  if (c && c->type == 4 && c->p
52
      && !(c->p->flags & (1<<12)))
53
    never_ever(gi + 7, c->p);
54
  if (c && c->type == 4 && c->p
55
      && !(c->p->flags & (1<<11)))
56
    never_ever(gi + 8, c->p);
57
  if (c && c->type == 4 && c->p
58
      && !(c->p->flags & (1<<10)))
59
    never_ever(gi + 9, c->p);
60
}
61
 
62
static void
63
foo(int * interp, Pcc_cell *c)
64
{
65
  mark_cell(interp, c);
66
}
67
 
68
static struct Pcc_cell *
69
__attribute__((noinline,noclone))
70
getnull(void)
71
{
72
  return (struct Pcc_cell *) 0;
73
}
74
 
75
 
76
int main()
77
{
78
  int i;
79
 
80
  cond = 1;
81
  for (i = 0; i < 100; i++)
82
    foo (&gi, getnull ());
83
  return 0;
84
}
85
 
86
 
87
void
88
bar_1 (int * interp, Pcc_cell *c)
89
{
90
  c->bla += 1;
91
  mark_cell(interp, c);
92
}
93
 
94
void
95
bar_2 (int * interp, Pcc_cell *c)
96
{
97
  c->bla += 2;
98
  mark_cell(interp, c);
99
}
100
 

powered by: WebSVN 2.1.0

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