On 3/4/19 4:16 PM, Peter Bergner wrote:
> Index: gcc/config/rs6000/rs6000.c
> ===================================================================
> --- gcc/config/rs6000/rs6000.c (revision 269028)
> +++ gcc/config/rs6000/rs6000.c (working copy)
> @@ -9887,7 +9887,7 @@ valid_sf_si_move (rtx dest, rtx src, mac
> static bool
> rs6000_emit_move_si_sf_subreg (rtx dest, rtx source, machine_mode mode)
> {
> - if (TARGET_DIRECT_MOVE_64BIT && !lra_in_progress && !reload_completed
> + if (TARGET_DIRECT_MOVE_64BIT && !reload_completed
> && (!SUBREG_P (dest) || !sf_subreg_operand (dest, mode))
> && SUBREG_P (source) && sf_subreg_operand (source, mode))
> {
> @@ -9902,7 +9902,9 @@ rs6000_emit_move_si_sf_subreg (rtx dest,
>
> if (mode == SFmode && inner_mode == SImode)
> {
> - emit_insn (gen_movsf_from_si (dest, inner_source));
> + rtx_insn *insn = emit_insn (gen_movsf_from_si (dest, inner_source));
> + if (lra_in_progress)
> + remove_scratches_1 (insn);
> return true;
> }
> }
But maybe the call to remove_scratches_1() should move to lra_emit_move(),
which is how we get to this code in the first place? Who knows what other
generic move patterns might need scratches?
Peter