PR c++/37276
[official-gcc.git] / gcc / testsuite / gcc.dg / pr50340.c
blob18430366fe13d6d19fe546b01c1f125fd01d3564
1 /* { dg-do compile { target powerpc*-*-* ia64-*-* i?86-*-* x86_64-*-* } } */
2 /* { dg-options "-O3 -fselective-scheduling2 -funroll-loops" } */
3 extern int mode_size[];
4 typedef unsigned HARD_REG_SET[ ((64 + 32 - 1) / 32) ];
5 enum reload_type {
6 RELOAD_FOR_INPUT,
7 RELOAD_FOR_OUTPUT,
8 RELOAD_FOR_INSN,
9 RELOAD_FOR_INPUT_ADDRESS,
10 RELOAD_FOR_OUTPUT_ADDRESS,
11 RELOAD_FOR_OPERAND_ADDRESS,
12 RELOAD_FOR_OPADDR_ADDR,
13 RELOAD_OTHER,
14 RELOAD_FOR_OTHER_ADDRESS
16 static HARD_REG_SET reload_reg_used;
17 static HARD_REG_SET reload_reg_used_in_input_addr[10];
18 static HARD_REG_SET reload_reg_used_in_output_addr[10];
19 static HARD_REG_SET reload_reg_used_in_input[10];
20 static HARD_REG_SET reload_reg_used_in_output[10];
21 static HARD_REG_SET reload_reg_used_in_op_addr;
22 static HARD_REG_SET reload_reg_used_in_op_addr_reload;
23 static HARD_REG_SET reload_reg_used_in_insn;
24 static HARD_REG_SET reload_reg_used_in_other_addr;
25 static HARD_REG_SET reload_reg_used_at_all;
26 void __attribute__((cold)) mark_reload_reg_in_use (regno, opnum, type, mode)
28 int nregs = regno ? 1 : mode_size[mode];
29 int i;
30 for (i = regno; i < nregs + regno; i++)
32 switch (type)
34 case RELOAD_OTHER: reload_reg_used[i / 32u] |= 1 << i % 32u; break;
35 case RELOAD_FOR_INPUT_ADDRESS: reload_reg_used_in_input_addr[opnum][i / 32u] |= 1 << i % 32u; break;
36 case RELOAD_FOR_OUTPUT_ADDRESS: reload_reg_used_in_output_addr[opnum][i / 32u] |= 1 << i % 32u; break;
37 case RELOAD_FOR_OPERAND_ADDRESS: reload_reg_used_in_op_addr[i / 32u] |= 1 << i % 32u; break;
38 case RELOAD_FOR_OPADDR_ADDR: reload_reg_used_in_op_addr_reload[i / 32u] |= 1 << i % 32u; break;
39 case RELOAD_FOR_OTHER_ADDRESS: reload_reg_used_in_other_addr[i / 32u] |= 1; break;
40 case RELOAD_FOR_INPUT: reload_reg_used_in_input[opnum][i / 32u] |= 1 << i % 32u; break;
41 case RELOAD_FOR_OUTPUT: reload_reg_used_in_output[opnum][i / 32u] |= 1 << i % 32u; break;
42 case RELOAD_FOR_INSN: reload_reg_used_in_insn[i / 32u] |= 1 << i % 32u;
44 reload_reg_used_at_all[i / 32u] |= 1 << i;