diff options
author | Vladimir Makarov <vmakarov@redhat.com> | 2018-12-06 18:41:46 +0000 |
---|---|---|
committer | Vladimir Makarov <vmakarov@gcc.gnu.org> | 2018-12-06 18:41:46 +0000 |
commit | e384094ac2e3bf7bac69453fb0579fa8a7c35b3e (patch) | |
tree | 2bce7236e1397dd1d66b05e14857892d6e6a6abe /gcc/ira.c | |
parent | 5da8ebe9c61f304107b1bcb5146e068093b72d0d (diff) | |
download | gcc-e384094ac2e3bf7bac69453fb0579fa8a7c35b3e.zip gcc-e384094ac2e3bf7bac69453fb0579fa8a7c35b3e.tar.gz gcc-e384094ac2e3bf7bac69453fb0579fa8a7c35b3e.tar.bz2 |
re PR target/88282 (ICE in df_install_refs at gcc/df-scan.c:2379)
2018-12-06 Vladimir Makarov <vmakarov@redhat.com>
PR target/88282
* ira.c (ira_init_register_move_cost): Use info from
hard_regno_mode_ok instead of contains_reg_of_mode.
* ira-costs.c (contains_reg_of_mode): Don't use cost from bigger
hard register class for some fixed hard registers.
From-SVN: r266862
Diffstat (limited to 'gcc/ira.c')
-rw-r--r-- | gcc/ira.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1573,11 +1573,17 @@ ira_init_register_move_cost (machine_mode mode) { static unsigned short last_move_cost[N_REG_CLASSES][N_REG_CLASSES]; bool all_match = true; - unsigned int cl1, cl2; + unsigned int i, cl1, cl2; + HARD_REG_SET ok_regs; ira_assert (ira_register_move_cost[mode] == NULL && ira_may_move_in_cost[mode] == NULL && ira_may_move_out_cost[mode] == NULL); + CLEAR_HARD_REG_SET (ok_regs); + for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) + if (targetm.hard_regno_mode_ok (i, mode)) + SET_HARD_REG_BIT (ok_regs, i); + /* Note that we might be asked about the move costs of modes that cannot be stored in any hard register, for example if an inline asm tries to create a register operand with an impossible mode. @@ -1586,8 +1592,8 @@ ira_init_register_move_cost (machine_mode mode) for (cl2 = 0; cl2 < N_REG_CLASSES; cl2++) { int cost; - if (!contains_reg_of_mode[cl1][mode] - || !contains_reg_of_mode[cl2][mode]) + if (!hard_reg_set_intersect_p (ok_regs, reg_class_contents[cl1]) + || !hard_reg_set_intersect_p (ok_regs, reg_class_contents[cl2])) { if ((ira_reg_class_max_nregs[cl1][mode] > ira_class_hard_regs_num[cl1]) |