reorg.c (fill_slots_from_thread): Improve for TARGET_FLAGS_REGNUM targets

Eric Botcazou botcazou@adacore.com
Fri Sep 11 11:09:48 GMT 2020


> @@ -2618,6 +2643,16 @@ fill_slots_from_thread (rtx_jump_insn *insn, rtx
> condition, lose = 1;
>        mark_set_resources (trial, &set, 0, MARK_SRC_DEST_CALL);
>        mark_referenced_resources (trial, &needed, true);
> +      if (filter_flags)
> +	{
> +	  mark_set_resources (trial, &fset, 0, MARK_SRC_DEST_CALL);
> +
> +	  /* Groups of flags-register setters with users should not
> +	     affect opportunities to move flags-register-setting insns
> +	     (clobbers) into the delay-slot.  */
> +	  CLEAR_HARD_REG_BIT (needed.regs, targetm.flags_regnum);
> +	  CLEAR_HARD_REG_BIT (fset.regs, targetm.flags_regnum);
> +	}

Don't you need to put the new block before mark_referenced_resources (as I did 
in fill_simple_delay_slots) in case the needed insn reads the flags register?

-- 
Eric Botcazou




More information about the Gcc-patches mailing list