summaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-12 09:44:16 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-12 09:44:16 +0000
commitf391504caa41e1dba013c6fc2f6b73d3d91d424b (patch)
treed1744bed287bf158f3ba33cbaf31e8ac5720aefb /gcc/cselib.c
parent115addd6f75b9a540c34a162f151b190e8dd7165 (diff)
downloadgcc-f391504caa41e1dba013c6fc2f6b73d3d91d424b.tar.gz
Partial fox for PR opt/10776 II
* cselib.c: Include params.h (cselib_invalidate_mem): Limit amount of nonconflicting memory locations. * params.def (PARAM_MAX_CSELIB_MEMORY_LOCATIONS): New. * Makefile.in (cselib.o): Depend on params.h git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75710 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index 8cb325d61a5..99c4bec1c41 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -39,6 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "ggc.h"
#include "hashtab.h"
#include "cselib.h"
+#include "params.h"
static int entry_and_rtx_equal_p (const void *, const void *);
static hashval_t get_value_hash (const void *);
@@ -1114,6 +1115,7 @@ static void
cselib_invalidate_mem (rtx mem_rtx)
{
cselib_val **vp, *v, *next;
+ int num_mems = 0;
vp = &first_containing_mem;
for (v = *vp; v != &dummy_val; v = next)
@@ -1135,9 +1137,11 @@ cselib_invalidate_mem (rtx mem_rtx)
p = &(*p)->next;
continue;
}
- if (! cselib_mem_conflict_p (mem_rtx, x))
+ if (num_mems < PARAM_VALUE (PARAM_MAX_CSELIB_MEMORY_LOCATIONS)
+ && ! cselib_mem_conflict_p (mem_rtx, x))
{
has_mem = true;
+ num_mems++;
p = &(*p)->next;
continue;
}