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].
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);