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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [multi-ix.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for a reload bug:
2
   if you have a memory reference using the indexed addressing
3
   mode, and the base address is a pseudo containing an address in the frame
4
   and this pseudo fails to get a hard register, we end up with a double PLUS,
5
   so the frame address gets reloaded.  Now, when the index got a hard register,
6
   and it dies in this insn, push_reload will consider that hard register as
7
   a reload register, and disregrad overlaps with rld[n_reloads].in .  That is
8
   fine as long as the add can be done with a single insn, but when the
9
   constant is so large that it has to be reloaded into a register first,
10
   that clobbers the index.  */
11
 
12
#include <stdarg.h>
13
 
14
#ifdef STACK_SIZE
15
#define CHUNK ((STACK_SIZE-100)/40/sizeof(int))
16
#else
17
#define CHUNK 500
18
#endif
19
 
20
void s(int, ...);
21
void z(int, ...);
22
void c(int, ...);
23
 
24
typedef int l[CHUNK];
25
 
26
void
27
f (int n)
28
{
29
  int i;
30
  l a0, a1, a2, a3, a4, a5, a6, a7, a8, a9;
31
  l a10, a11, a12, a13, a14, a15, a16, a17, a18, a19;
32
  l a20, a21, a22, a23, a24, a25, a26, a27, a28, a29;
33
  l a30, a31, a32, a33, a34, a35, a36, a37, a38, a39;
34
  int i0, i1, i2, i3, i4, i5, i6, i7, i8, i9;
35
  int i10, i11, i12, i13, i14, i15, i16, i17, i18, i19;
36
  int i20, i21, i22, i23, i24, i25, i26, i27, i28, i29;
37
  int i30, i31, i32, i33, i34, i35, i36, i37, i38, i39;
38
 
39
  for (i = 0; i < n; i++)
40
    {
41
      s (40, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
42
         a10, a11, a12, a13, a14, a15, a16, a17, a18, a19,
43
         a20, a21, a22, a23, a24, a25, a26, a27, a28, a29,
44
         a30, a31, a32, a33, a34, a35, a36, a37, a38, a39);
45
      i0 = a0[0];
46
      i1 = a1[0];
47
      i2 = a2[0];
48
      i3 = a3[0];
49
      i4 = a4[0];
50
      i5 = a5[0];
51
      i6 = a6[0];
52
      i7 = a7[0];
53
      i8 = a8[0];
54
      i9 = a9[0];
55
      i10 = a10[0];
56
      i11 = a11[0];
57
      i12 = a12[0];
58
      i13 = a13[0];
59
      i14 = a14[0];
60
      i15 = a15[0];
61
      i16 = a16[0];
62
      i17 = a17[0];
63
      i18 = a18[0];
64
      i19 = a19[0];
65
      i20 = a20[0];
66
      i21 = a21[0];
67
      i22 = a22[0];
68
      i23 = a23[0];
69
      i24 = a24[0];
70
      i25 = a25[0];
71
      i26 = a26[0];
72
      i27 = a27[0];
73
      i28 = a28[0];
74
      i29 = a29[0];
75
      i30 = a30[0];
76
      i31 = a31[0];
77
      i32 = a32[0];
78
      i33 = a33[0];
79
      i34 = a34[0];
80
      i35 = a35[0];
81
      i36 = a36[0];
82
      i37 = a37[0];
83
      i38 = a38[0];
84
      i39 = a39[0];
85
      z (40, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
86
         a10, a11, a12, a13, a14, a15, a16, a17, a18, a19,
87
         a20, a21, a22, a23, a24, a25, a26, a27, a28, a29,
88
         a30, a31, a32, a33, a34, a35, a36, a37, a38, a39);
89
      a0[i0] = i0;
90
      a1[i1] = i1;
91
      a2[i2] = i2;
92
      a3[i3] = i3;
93
      a4[i4] = i4;
94
      a5[i5] = i5;
95
      a6[i6] = i6;
96
      a7[i7] = i7;
97
      a8[i8] = i8;
98
      a9[i9] = i9;
99
      a10[i10] = i10;
100
      a11[i11] = i11;
101
      a12[i12] = i12;
102
      a13[i13] = i13;
103
      a14[i14] = i14;
104
      a15[i15] = i15;
105
      a16[i16] = i16;
106
      a17[i17] = i17;
107
      a18[i18] = i18;
108
      a19[i19] = i19;
109
      a20[i20] = i20;
110
      a21[i21] = i21;
111
      a22[i22] = i22;
112
      a23[i23] = i23;
113
      a24[i24] = i24;
114
      a25[i25] = i25;
115
      a26[i26] = i26;
116
      a27[i27] = i27;
117
      a28[i28] = i28;
118
      a29[i29] = i29;
119
      a30[i30] = i30;
120
      a31[i31] = i31;
121
      a32[i32] = i32;
122
      a33[i33] = i33;
123
      a34[i34] = i34;
124
      a35[i35] = i35;
125
      a36[i36] = i36;
126
      a37[i37] = i37;
127
      a38[i38] = i38;
128
      a39[i39] = i39;
129
      c (40, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9,
130
         a10, a11, a12, a13, a14, a15, a16, a17, a18, a19,
131
         a20, a21, a22, a23, a24, a25, a26, a27, a28, a29,
132
         a30, a31, a32, a33, a34, a35, a36, a37, a38, a39);
133
    }
134
}
135
 
136
int
137
main ()
138
{
139
  f (1);
140
  exit (0);
141
}
142
 
143
void s(int n, ...)
144
{
145
  va_list list;
146
 
147
  va_start (list, n);
148
  while (n--)
149
    {
150
      int *a = va_arg (list, int *);
151
      a[0] = n;
152
    }
153
  va_end (list);
154
}
155
 
156
void z(int n, ...)
157
{
158
  va_list list;
159
 
160
  va_start (list, n);
161
  while (n--)
162
    {
163
      int *a = va_arg (list, int *);
164
      __builtin_bzero (a, sizeof (l));
165
    }
166
  va_end (list);
167
}
168
 
169
void c(int n, ...)
170
{
171
  va_list list;
172
 
173
  va_start (list, n);
174
  while (n--)
175
    {
176
      int *a = va_arg (list, int *);
177
      if (a[n] != n)
178
        abort ();
179
    }
180
  va_end (list);
181
}

powered by: WebSVN 2.1.0

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