diff options
author | Jeff Law <law@redhat.com> | 2017-02-14 09:44:33 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 2017-02-14 09:44:33 -0700 |
commit | 355930ab262ceeb4dec0dd1094fd1dee8d9186c6 (patch) | |
tree | d6f522db335682c6806a7b704b54c95e51813b9d | |
parent | 6fa3b207c38e7855bfb764a75de694d3a250df3d (diff) | |
download | gcc-355930ab262ceeb4dec0dd1094fd1dee8d9186c6.zip gcc-355930ab262ceeb4dec0dd1094fd1dee8d9186c6.tar.gz gcc-355930ab262ceeb4dec0dd1094fd1dee8d9186c6.tar.bz2 |
re PR target/79404 (h8300: ICE at gcc/ira.c:5541 whilst building libgcc)
PR target/79404
* ira-costs.c (scan_one_insn): Initialize register move costs
for pseudos seen in USE/CLOBBER insns.
From-SVN: r245436
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/ira-costs.c | 18 |
2 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3c376ae..bd6fdb4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -4,6 +4,10 @@ 2017-02-14 Jeff Law <law@redhat.com> + PR target/79404 + * ira-costs.c (scan_one_insn): Initialize register move costs + for pseudos seen in USE/CLOBBER insns. + PR tree-optimization/79095 * tree-vrp.c (extract_range_from_binary_expr_1): For EXACT_DIV_EXPR, if the numerator has the range ~[0,0] make the resultant range ~[0,0]. diff --git a/gcc/ira-costs.c b/gcc/ira-costs.c index c561db6..1737430 100644 --- a/gcc/ira-costs.c +++ b/gcc/ira-costs.c @@ -1438,9 +1438,25 @@ scan_one_insn (rtx_insn *insn) return insn; pat_code = GET_CODE (PATTERN (insn)); - if (pat_code == USE || pat_code == CLOBBER || pat_code == ASM_INPUT) + if (pat_code == ASM_INPUT) return insn; + /* If INSN is a USE/CLOBBER of a pseudo in a mode M then go ahead + and initialize the register move costs of mode M. + + The pseudo may be related to another pseudo via a copy (implicit or + explicit) and if there are no mode M uses/sets of the original + pseudo, then we may leave the register move costs uninitialized for + mode M. */ + if (pat_code == USE || pat_code == CLOBBER) + { + rtx x = XEXP (PATTERN (insn), 0); + if (GET_CODE (x) == REG + && REGNO (x) >= FIRST_PSEUDO_REGISTER) + ira_init_register_move_cost_if_necessary (GET_MODE (x)); + return insn; + } + counted_mem = false; set = single_set (insn); extract_insn (insn); |