]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/reload1.c
Simplify setjmp and non-local goto implementation (PR84521)
[thirdparty/gcc.git] / gcc / reload1.c
index 5039ceed5816dc5567274ff64e849c2c4f998bb4..3ad6f1d9c1f7a72c4c39ddbaa3e3caf3e903557e 100644 (file)
@@ -3234,96 +3234,6 @@ eliminate_regs_in_insn (rtx_insn *insn, int replace)
       return 0;
     }
 
-  if (old_set != 0 && REG_P (SET_DEST (old_set))
-      && REGNO (SET_DEST (old_set)) < FIRST_PSEUDO_REGISTER)
-    {
-      /* Check for setting an eliminable register.  */
-      for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
-       if (ep->from_rtx == SET_DEST (old_set) && ep->can_eliminate)
-         {
-           /* If this is setting the frame pointer register to the
-              hardware frame pointer register and this is an elimination
-              that will be done (tested above), this insn is really
-              adjusting the frame pointer downward to compensate for
-              the adjustment done before a nonlocal goto.  */
-           if (!HARD_FRAME_POINTER_IS_FRAME_POINTER
-               && ep->from == FRAME_POINTER_REGNUM
-               && ep->to == HARD_FRAME_POINTER_REGNUM)
-             {
-               rtx base = SET_SRC (old_set);
-               rtx_insn *base_insn = insn;
-               HOST_WIDE_INT offset = 0;
-
-               while (base != ep->to_rtx)
-                 {
-                   rtx_insn *prev_insn;
-                   rtx prev_set;
-
-                   if (GET_CODE (base) == PLUS
-                       && CONST_INT_P (XEXP (base, 1)))
-                     {
-                       offset += INTVAL (XEXP (base, 1));
-                       base = XEXP (base, 0);
-                     }
-                   else if ((prev_insn = prev_nonnote_insn (base_insn)) != 0
-                            && (prev_set = single_set (prev_insn)) != 0
-                            && rtx_equal_p (SET_DEST (prev_set), base))
-                     {
-                       base = SET_SRC (prev_set);
-                       base_insn = prev_insn;
-                     }
-                   else
-                     break;
-                 }
-
-               if (base == ep->to_rtx)
-                 {
-                   rtx src = plus_constant (Pmode, ep->to_rtx,
-                                            offset - ep->offset);
-
-                   new_body = old_body;
-                   if (! replace)
-                     {
-                       new_body = copy_insn (old_body);
-                       if (REG_NOTES (insn))
-                         REG_NOTES (insn) = copy_insn_1 (REG_NOTES (insn));
-                     }
-                   PATTERN (insn) = new_body;
-                   old_set = single_set (insn);
-
-                   /* First see if this insn remains valid when we
-                      make the change.  If not, keep the INSN_CODE
-                      the same and let reload fit it up.  */
-                   validate_change (insn, &SET_SRC (old_set), src, 1);
-                   validate_change (insn, &SET_DEST (old_set),
-                                    ep->to_rtx, 1);
-                   if (! apply_change_group ())
-                     {
-                       SET_SRC (old_set) = src;
-                       SET_DEST (old_set) = ep->to_rtx;
-                     }
-
-                   val = 1;
-                   goto done;
-                 }
-             }
-
-           /* In this case this insn isn't serving a useful purpose.  We
-              will delete it in reload_as_needed once we know that this
-              elimination is, in fact, being done.
-
-              If REPLACE isn't set, we can't delete this insn, but needn't
-              process it since it won't be used unless something changes.  */
-           if (replace)
-             {
-               delete_dead_insn (insn);
-               return 1;
-             }
-           val = 1;
-           goto done;
-         }
-    }
-
   /* We allow one special case which happens to work on all machines we
      currently support: a single set with the source or a REG_EQUAL
      note being a PLUS of an eliminable register and a constant.  */