1 /* PR optimization/9888 */
2 /* Originator: Jim Bray <jb@as220.org> */
3 /* { dg-do run { target i?86-*-* } } */
4 /* { dg-options "-mtune=k6 -Os" } */
8 RELOAD_FOR_INPUT
, RELOAD_FOR_OUTPUT
, RELOAD_FOR_INSN
,
9 RELOAD_FOR_INPUT_ADDRESS
, RELOAD_FOR_INPADDR_ADDRESS
,
10 RELOAD_FOR_OUTPUT_ADDRESS
, RELOAD_FOR_OUTADDR_ADDRESS
,
11 RELOAD_FOR_OPERAND_ADDRESS
, RELOAD_FOR_OPADDR_ADDR
,
12 RELOAD_OTHER
, RELOAD_FOR_OTHER_ADDRESS
17 /* My results, varying with FOO_SIZE:
18 30: asm error "value of ..fff77 too large:
26 enum reload_type when_needed
;
27 unsigned int optional
:1;
28 unsigned int secondary_p
:1;
33 struct reload rld
[N_RELOADS
];
34 int n_reloads
= N_RELOADS
;
40 enum reload_type operand_type
[1];
42 enum reload_type address_type
[1];
44 int operand_reloadnum
[1];
45 int goal_alternative_matches
[1];
47 for (i
= 0; i
< n_reloads
; i
++)
49 if (rld
[i
].secondary_p
50 && rld
[i
].when_needed
== operand_type
[rld
[i
].opnum
])
51 rld
[i
].when_needed
= address_type
[rld
[i
].opnum
];
53 if ((rld
[i
].when_needed
== RELOAD_FOR_INPUT_ADDRESS
54 || rld
[i
].when_needed
== RELOAD_FOR_OUTPUT_ADDRESS
55 || rld
[i
].when_needed
== RELOAD_FOR_INPADDR_ADDRESS
56 || rld
[i
].when_needed
== RELOAD_FOR_OUTADDR_ADDRESS
)
57 && (operand_reloadnum
[rld
[i
].opnum
] < 0
58 || rld
[operand_reloadnum
[rld
[i
].opnum
]].optional
))
61 if (rld
[i
].when_needed
== RELOAD_FOR_INPADDR_ADDRESS
62 || rld
[i
].when_needed
== RELOAD_FOR_OUTADDR_ADDRESS
)
63 rld
[i
].when_needed
= RELOAD_FOR_OPADDR_ADDR
;
65 rld
[i
].when_needed
= RELOAD_FOR_OPERAND_ADDRESS
;
68 if ((rld
[i
].when_needed
== RELOAD_FOR_INPUT_ADDRESS
69 || rld
[i
].when_needed
== RELOAD_FOR_INPADDR_ADDRESS
)
70 && operand_reloadnum
[rld
[i
].opnum
] >= 0
71 && (rld
[operand_reloadnum
[rld
[i
].opnum
]].when_needed
73 rld
[i
].when_needed
= RELOAD_FOR_OTHER_ADDRESS
;
75 if (goal_alternative_matches
[rld
[i
].opnum
] >= 0)
76 rld
[i
].opnum
= goal_alternative_matches
[rld
[i
].opnum
];