| 1 |
/* This code is from the beginning of combine_reloads in reload.c in |
| 2 |
GCC 3.1-20020117, with simplifications. It compiled incorrectly |
| 3 |
for -O2 -fprefetch-loop-arrays for ix86 targets. */ |
| 4 |
|
| 5 |
/* { dg-do run } */ |
| 6 |
/* { dg-options "-O2 -fprefetch-loop-arrays" } */ |
| 7 |
/* { dg-options "-O2 -fprefetch-loop-arrays -mtune=pentium3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */ |
| 8 |
/* { dg-prune-output ".-fprefetch-loop-arrays. not supported for this target" } */ |
| 9 |
|
| 10 |
|
| 11 |
struct reload |
| 12 |
{ |
| 13 |
int first_member; |
| 14 |
int out; |
| 15 |
int final_member; |
| 16 |
}; |
| 17 |
|
| 18 |
int n_reloads; |
| 19 |
struct reload rld[10]; |
| 20 |
|
| 21 |
static int |
| 22 |
combine_reloads () |
| 23 |
{ |
| 24 |
int i; |
| 25 |
int output_reload = -1; |
| 26 |
int secondary_out = -1; |
| 27 |
|
| 28 |
for (i = 0; i < n_reloads; i++) |
| 29 |
if (rld[i].out != 0) |
| 30 |
{ |
| 31 |
if (output_reload >= 0) |
| 32 |
return output_reload; |
| 33 |
output_reload = i; |
| 34 |
} |
| 35 |
return output_reload; |
| 36 |
} |
| 37 |
|
| 38 |
int |
| 39 |
main () |
| 40 |
{ |
| 41 |
n_reloads = 4; |
| 42 |
rld[2].out = 2; |
| 43 |
if (combine_reloads () != 2) |
| 44 |
__builtin_abort (); |
| 45 |
__builtin_exit (0); |
| 46 |
} |