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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20080519-1.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
extern void abort (void);
2
 
3
typedef unsigned long HARD_REG_SET[2];
4
HARD_REG_SET reg_class_contents[2];
5
 
6
struct du_chain
7
{
8
  struct du_chain *next_use;
9
  int cl;
10
};
11
 
12
void __attribute__((noinline))
13
merge_overlapping_regs (HARD_REG_SET *p)
14
{
15
  if ((*p)[0] != -1 || (*p)[1] != -1)
16
    abort ();
17
}
18
 
19
void __attribute__((noinline))
20
regrename_optimize (struct du_chain *this)
21
{
22
  HARD_REG_SET this_unavailable;
23
  unsigned long *scan_fp_;
24
  int n_uses;
25
  struct du_chain *last;
26
 
27
  this_unavailable[0] = 0;
28
  this_unavailable[1] = 0;
29
 
30
  n_uses = 0;
31
  for (last = this; last->next_use; last = last->next_use)
32
    {
33
      scan_fp_ = reg_class_contents[last->cl];
34
      n_uses++;
35
      this_unavailable[0] |= ~ scan_fp_[0];
36
      this_unavailable[1] |= ~ scan_fp_[1];
37
    }
38
  if (n_uses < 1)
39
    return;
40
 
41
  scan_fp_ = reg_class_contents[last->cl];
42
  this_unavailable[0] |= ~ scan_fp_[0];
43
  this_unavailable[1] |= ~ scan_fp_[1];
44
 
45
  merge_overlapping_regs (&this_unavailable);
46
}
47
 
48
int main()
49
{
50
  struct du_chain du1 = { 0, 0 };
51
  struct du_chain du0 = { &du1, 1 };
52
  reg_class_contents[0][0] = -1;
53
  reg_class_contents[0][1] = -1;
54
  reg_class_contents[1][0] = 0;
55
  reg_class_contents[1][1] = 0;
56
  regrename_optimize (&du0);
57
  return 0;
58
}

powered by: WebSVN 2.1.0

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