aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2004-01-11 16:56:26 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2004-01-11 15:56:26 +0000
commit0bcf8261f4b9ef56378971c1745dd79024d44063 (patch)
tree3185f928992e2f2f2b6335b02ae5207faecec34a /gcc/reload.c
parent09625c1681b30febed411fa7526cf4b620a54ab3 (diff)
downloadgcc-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/reload.c')
-rw-r--r--gcc/reload.c7
1 files changed, 6 insertions, 1 deletions
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