1 /* PR optimization/9888 */
2 /* Originator: Jim Bray <jb@as220.org> */
3 /* { dg-do run { target i?86-*-* x86_64-*-* } } */
4 /* { dg-require-effective-target ilp32 } */
5 /* { dg-options "-mtune=k6 -Os" } */
9 RELOAD_FOR_INPUT
, RELOAD_FOR_OUTPUT
, RELOAD_FOR_INSN
,
10 RELOAD_FOR_INPUT_ADDRESS
, RELOAD_FOR_INPADDR_ADDRESS
,
11 RELOAD_FOR_OUTPUT_ADDRESS
, RELOAD_FOR_OUTADDR_ADDRESS
,
12 RELOAD_FOR_OPERAND_ADDRESS
, RELOAD_FOR_OPADDR_ADDR
,
13 RELOAD_OTHER
, RELOAD_FOR_OTHER_ADDRESS
18 /* My results, varying with FOO_SIZE:
19 30: asm error "value of ..fff77 too large:
27 enum reload_type when_needed
;
28 unsigned int optional
:1;
29 unsigned int secondary_p
:1;
34 struct reload rld
[N_RELOADS
];
35 int n_reloads
= N_RELOADS
;
41 enum reload_type operand_type
[1];
43 enum reload_type address_type
[1];
45 int operand_reloadnum
[1];
46 int goal_alternative_matches
[1];
48 for (i
= 0; i
< n_reloads
; i
++)
50 if (rld
[i
].secondary_p
51 && rld
[i
].when_needed
== operand_type
[rld
[i
].opnum
])
52 rld
[i
].when_needed
= address_type
[rld
[i
].opnum
];
54 if ((rld
[i
].when_needed
== RELOAD_FOR_INPUT_ADDRESS
55 || rld
[i
].when_needed
== RELOAD_FOR_OUTPUT_ADDRESS
56 || rld
[i
].when_needed
== RELOAD_FOR_INPADDR_ADDRESS
57 || rld
[i
].when_needed
== RELOAD_FOR_OUTADDR_ADDRESS
)
58 && (operand_reloadnum
[rld
[i
].opnum
] < 0
59 || rld
[operand_reloadnum
[rld
[i
].opnum
]].optional
))
62 if (rld
[i
].when_needed
== RELOAD_FOR_INPADDR_ADDRESS
63 || rld
[i
].when_needed
== RELOAD_FOR_OUTADDR_ADDRESS
)
64 rld
[i
].when_needed
= RELOAD_FOR_OPADDR_ADDR
;
66 rld
[i
].when_needed
= RELOAD_FOR_OPERAND_ADDRESS
;
69 if ((rld
[i
].when_needed
== RELOAD_FOR_INPUT_ADDRESS
70 || rld
[i
].when_needed
== RELOAD_FOR_INPADDR_ADDRESS
)
71 && operand_reloadnum
[rld
[i
].opnum
] >= 0
72 && (rld
[operand_reloadnum
[rld
[i
].opnum
]].when_needed
74 rld
[i
].when_needed
= RELOAD_FOR_OTHER_ADDRESS
;
76 if (goal_alternative_matches
[rld
[i
].opnum
] >= 0)
77 rld
[i
].opnum
= goal_alternative_matches
[rld
[i
].opnum
];