View | Details | Return to bug 60040 | Differences between
and this patch

Collapse All | Expand All

(-)a/gcc/reload1.c (-10 / +18 lines)
Lines 350-357 static void maybe_fix_stack_asms (void); Link Here
350
static void copy_reloads (struct insn_chain *);
350
static void copy_reloads (struct insn_chain *);
351
static void calculate_needs_all_insns (int);
351
static void calculate_needs_all_insns (int);
352
static int find_reg (struct insn_chain *, int);
352
static int find_reg (struct insn_chain *, int);
353
static void find_reload_regs (struct insn_chain *);
353
static void find_reload_regs (struct insn_chain *, bool tentative);
354
static void select_reload_regs (void);
354
static void select_reload_regs (bool);
355
static void delete_caller_save_insns (void);
355
static void delete_caller_save_insns (void);
356
356
357
static void spill_failure (rtx, enum reg_class);
357
static void spill_failure (rtx, enum reg_class);
Lines 970-977 reload (rtx first, int global) Link Here
970
	  something_changed = 1;
970
	  something_changed = 1;
971
	}
971
	}
972
972
973
      select_reload_regs ();
973
      select_reload_regs (something_changed);
974
      if (failure)
974
      if (failure && !something_changed)
975
	goto failed;
975
	goto failed;
976
      else failure = 0;
976
977
977
      if (insns_need_reload != 0 || did_spill)
978
      if (insns_need_reload != 0 || did_spill)
Lines 1977-1986 find_reg (struct insn_chain *chain, int order) Link Here
1977
   is given by CHAIN.
1977
   is given by CHAIN.
1978
   Do it by ascending class number, since otherwise a reg
1978
   Do it by ascending class number, since otherwise a reg
1979
   might be spilled for a big class and might fail to count
1979
   might be spilled for a big class and might fail to count
1980
   for a smaller class even though it belongs to that class.  */
1980
   for a smaller class even though it belongs to that class.
1981
   TENTATIVE means that we had some changes that might have invalidated
1982
   the reloads, e.g. on AVR, not eliminating FP to SP means we can address
1983
   stack slots directly - while at the same time we loose a pointer
1984
   reg that could otherwise be used for reloads.  */
1981
1985
1982
static void
1986
static void
1983
find_reload_regs (struct insn_chain *chain)
1987
find_reload_regs (struct insn_chain *chain, bool tentative)
1984
{
1988
{
1985
  int i;
1989
  int i;
1986
1990
Lines 2029-2037 find_reload_regs (struct insn_chain *chain) Link Here
2029
	  {
2033
	  {
2030
	    if (dump_file)
2034
	    if (dump_file)
2031
	      fprintf (dump_file, "reload failure for reload %d\n", r);
2035
	      fprintf (dump_file, "reload failure for reload %d\n", r);
2032
	    spill_failure (chain->insn, rld[r].rclass);
2033
	    failure = 1;
2036
	    failure = 1;
2034
	    return;
2037
	    if (!tentative)
2038
	      {
2039
		spill_failure (chain->insn, rld[r].rclass);
2040
		return;
2041
	      }
2035
	  }
2042
	  }
2036
    }
2043
    }
2037
2044
Lines 2042-2055 find_reload_regs (struct insn_chain *chain) Link Here
2042
}
2049
}
2043
2050
2044
static void
2051
static void
2045
select_reload_regs (void)
2052
select_reload_regs (bool tentative)
2046
{
2053
{
2047
  struct insn_chain *chain;
2054
  struct insn_chain *chain;
2048
2055
2049
  /* Try to satisfy the needs for each insn.  */
2056
  /* Try to satisfy the needs for each insn.  */
2050
  for (chain = insns_need_reload; chain != 0;
2057
  for (chain = insns_need_reload; chain != 0;
2051
       chain = chain->next_need_reload)
2058
       chain = chain->next_need_reload)
2052
    find_reload_regs (chain);
2059
    find_reload_regs (chain, tentative);
2053
}
2060
}
2054
2061
2055
/* Delete all insns that were inserted by emit_caller_save_insns during
2062
/* Delete all insns that were inserted by emit_caller_save_insns during

Return to bug 60040