+2004-01-11 Jan Hubicka <jh@suse.cz>
+
+ Partial fix for PR opt/10776
+ * Makefile.in (reload.o): Include param.h
+ * params.def (PARAM_MAX_RELOAD_SEARCH_INSNS): New parameter.
+ * reload.c: Include params.h.
+ (find_equiv_reg): Work limiting check.
+ * invoke.texi: Document.
+
2004-01-11 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.c (mips_symbolic_constant_p): Don't allow
output.h except.h ra.h reload.h insn-config.h
reload.o : reload.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h output.h \
$(EXPR_H) $(OPTABS_H) reload.h $(RECOG_H) hard-reg-set.h insn-config.h \
- $(REGS_H) function.h real.h toplev.h $(TM_P_H)
+ $(REGS_H) function.h real.h toplev.h $(TM_P_H) $(PARAMS_H)
reload1.o : reload1.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) real.h flags.h \
$(EXPR_H) $(OPTABS_H) reload.h $(REGS_H) hard-reg-set.h insn-config.h \
$(BASIC_BLOCK_H) $(RECOG_H) output.h function.h toplev.h $(TM_P_H) \
this parameter and @option{ggc-min-expand} to zero causes a full
collection to occur at every opportunity.
+@table @gcctabopt
+@item max-reload-search-insns
+The maximum number of instruction reload should look backward for equivalent
+register. Increasing values mean more aggressive optimization, making the
+compile time increase with probably slightly better performance. The default
+value is 100.
+
+
@item reorder-blocks-duplicate
@itemx reorder-blocks-duplicate-feedback
#undef GGC_MIN_EXPAND_DEFAULT
#undef GGC_MIN_HEAPSIZE_DEFAULT
+DEFPARAM(PARAM_MAX_RELOAD_SEARCH_INSNS,
+ "max-reload-search-insns",
+ "The maximum number of instructions to search backward when looking for equivalent reload",
+ 100)
+
/*
Local variables:
mode:c
#include "output.h"
#include "function.h"
#include "toplev.h"
+#include "params.h"
#ifndef REGNO_MODE_OK_FOR_BASE_P
#define REGNO_MODE_OK_FOR_BASE_P(REGNO, MODE) REGNO_OK_FOR_BASE_P (REGNO)
int need_stable_sp = 0;
int nregs;
int valuenregs;
+ int num = 0;
if (goal == 0)
regno = goalreg;
else
return 0;
+ num = 0;
/* Scan insns back from INSN, looking for one that copies
a value into or out of GOAL.
Stop and give up if we reach a label. */
while (1)
{
p = PREV_INSN (p);
- if (p == 0 || GET_CODE (p) == CODE_LABEL)
+ num++;
+ if (p == 0 || GET_CODE (p) == CODE_LABEL
+ || num > PARAM_VALUE (PARAM_MAX_RELOAD_SEARCH_INSNS))
return 0;
if (GET_CODE (p) == INSN