]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/reorg.c
reorg.c (fill_slots_from_thread): Reinstate code typoed out in "Remove CC0".
[gcc.git] / gcc / reorg.c
index 4595f9a541f004ed4a4ad243a342e3ee64e5c599..7f06a6f6d092c4aa1f3aa165a038601cbcf8e49a 100644 (file)
@@ -2375,6 +2375,16 @@ fill_slots_from_thread (rtx_jump_insn *insn, rtx condition,
       if (! insn_references_resource_p (trial, &set, true)
          && ! insn_sets_resource_p (trial, filter_flags ? &fset : &set, true)
          && ! insn_sets_resource_p (trial, &needed, true)
+         /* If we're handling sets to the flags register specially, we
+            only allow an insn into a delay-slot, if it either:
+            - doesn't set the flags register,
+            - the "set" of the flags register isn't used (clobbered),
+            - insns between the delay-slot insn and the trial-insn
+            as accounted in "set", have not affected the flags register.  */
+         && (! filter_flags
+             || ! insn_sets_resource_p (trial, &flags_res, true)
+             || find_regno_note (trial, REG_UNUSED, targetm.flags_regnum)
+             || ! TEST_HARD_REG_BIT (set.regs, targetm.flags_regnum))
          && ! can_throw_internal (trial))
        {
          rtx_insn *prior_insn;
This page took 0.026012 seconds and 5 git commands to generate.