diff options
author | Jan Hubicka <jh@suse.cz> | 2004-01-11 16:56:26 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2004-01-11 15:56:26 +0000 |
commit | 0bcf8261f4b9ef56378971c1745dd79024d44063 (patch) | |
tree | 3185f928992e2f2f2b6335b02ae5207faecec34a /gcc | |
parent | 09625c1681b30febed411fa7526cf4b620a54ab3 (diff) | |
download | gcc-0bcf8261f4b9ef56378971c1745dd79024d44063.zip gcc-0bcf8261f4b9ef56378971c1745dd79024d44063.tar.gz gcc-0bcf8261f4b9ef56378971c1745dd79024d44063.tar.bz2 |
Partial fix for PR opt/10776
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.
From-SVN: r75679
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 8 | ||||
-rw-r--r-- | gcc/params.def | 5 | ||||
-rw-r--r-- | gcc/reload.c | 7 |
5 files changed, 29 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6d23396..5dee099 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 101408e..fde9b84 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1755,7 +1755,7 @@ ra-rewrite.o : ra-rewrite.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) 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) \ diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index b57ccd9..2431cc7 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4853,6 +4853,14 @@ parameter very large effectively disables garbage collection. Setting 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 diff --git a/gcc/params.def b/gcc/params.def index d665ad5..a5b3099 100644 --- a/gcc/params.def +++ b/gcc/params.def @@ -260,6 +260,11 @@ DEFPARAM(GGC_MIN_HEAPSIZE, #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 diff --git a/gcc/reload.c b/gcc/reload.c index 13f6900..361a502 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -104,6 +104,7 @@ a register with any other reload. */ #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) @@ -6383,6 +6384,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, int need_stable_sp = 0; int nregs; int valuenregs; + int num = 0; if (goal == 0) regno = goalreg; @@ -6423,6 +6425,7 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, 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. */ @@ -6430,7 +6433,9 @@ find_equiv_reg (rtx goal, rtx insn, enum reg_class class, int other, 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 |