summaryrefslogtreecommitdiffstats
path: root/gcc/flow.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-16 13:57:17 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-16 13:57:17 +0000
commitb4486a2479397c11ca29576665cc01bcd091fdd9 (patch)
tree13b070b7d0c70bff21168ac998d0e82bd829891b /gcc/flow.c
parent794f30aff57f5d8fd646c67167710170cc96f305 (diff)
downloadppe42-gcc-b4486a2479397c11ca29576665cc01bcd091fdd9.tar.gz
ppe42-gcc-b4486a2479397c11ca29576665cc01bcd091fdd9.zip
* flow.c (struct propagate_block_info): Add mem_set_list_len.
(MAX_MEM_SET_LIST_LEN): New. (propagate_one_insn): Update mem_set_list_len. (invalidate_mems_from_autoinc): Likewise. (invalidate_mems_from_set): Likewise. (mark_used_regs): Likewise. (init_propagate_block_info): Likewise. Stop collecting memories when we reach MAX_MEM_SET_LIST_LEN. (mark_set_1): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39065 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flow.c')
-rw-r--r--gcc/flow.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/gcc/flow.c b/gcc/flow.c
index 734063848d7..acd25f2b410 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -316,6 +316,9 @@ struct propagate_block_info
regset reg_cond_reg;
#endif
+ /* The length of mem_set_list. */
+ int mem_set_list_len;
+
/* Non-zero if the value of CC0 is live. */
int cc0_live;
@@ -323,6 +326,10 @@ struct propagate_block_info
int flags;
};
+/* Maximum length of pbi->mem_set_list before we start dropping
+ new elements on the floor. */
+#define MAX_MEM_SET_LIST_LEN 100
+
/* Store the data structures necessary for depth-first search. */
struct depth_first_search_dsS {
/* stack for backtracking during the algorithm */
@@ -3877,7 +3884,10 @@ propagate_one_insn (pbi, insn)
/* Non-constant calls clobber memory. */
if (! CONST_CALL_P (insn))
- free_EXPR_LIST_list (&pbi->mem_set_list);
+ {
+ free_EXPR_LIST_list (&pbi->mem_set_list);
+ pbi->mem_set_list_len = 0;
+ }
/* There may be extra registers to be clobbered. */
for (note = CALL_INSN_FUNCTION_USAGE (insn);
@@ -3967,6 +3977,7 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags)
pbi->bb = bb;
pbi->reg_live = live;
pbi->mem_set_list = NULL_RTX;
+ pbi->mem_set_list_len = 0;
pbi->local_set = local_set;
pbi->cond_local_set = cond_local_set;
pbi->cc0_live = 0;
@@ -4111,6 +4122,8 @@ init_propagate_block_info (bb, live, local_set, cond_local_set, flags)
mem = shallow_copy_rtx (mem);
#endif
pbi->mem_set_list = alloc_EXPR_LIST (0, mem, pbi->mem_set_list);
+ if (++pbi->mem_set_list_len >= MAX_MEM_SET_LIST_LEN)
+ break;
}
}
}
@@ -4512,6 +4525,7 @@ invalidate_mems_from_autoinc (pbi, insn)
else
pbi->mem_set_list = next;
free_EXPR_LIST_node (temp);
+ pbi->mem_set_list_len--;
}
else
prev = temp;
@@ -4547,6 +4561,7 @@ invalidate_mems_from_set (pbi, exp)
else
pbi->mem_set_list = next;
free_EXPR_LIST_node (temp);
+ pbi->mem_set_list_len--;
}
else
prev = temp;
@@ -4743,7 +4758,8 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
if (insn && GET_CODE (reg) == MEM)
invalidate_mems_from_autoinc (pbi, insn);
- if (GET_CODE (reg) == MEM && ! side_effects_p (reg)
+ if (pbi->mem_set_list_len < MAX_MEM_SET_LIST_LEN
+ && GET_CODE (reg) == MEM && ! side_effects_p (reg)
/* ??? With more effort we could track conditional memory life. */
&& ! cond
/* We do not know the size of a BLKmode store, so we do not track
@@ -4761,6 +4777,7 @@ mark_set_1 (pbi, code, reg, cond, insn, flags)
reg = shallow_copy_rtx (reg);
#endif
pbi->mem_set_list = alloc_EXPR_LIST (0, reg, pbi->mem_set_list);
+ pbi->mem_set_list_len++;
}
}
@@ -5859,6 +5876,7 @@ mark_used_regs (pbi, x, cond, insn)
else
pbi->mem_set_list = next;
free_EXPR_LIST_node (temp);
+ pbi->mem_set_list_len--;
}
else
prev = temp;
@@ -5996,7 +6014,10 @@ mark_used_regs (pbi, x, cond, insn)
So for now, just clear the memory set list and mark any regs
we can find in ASM_OPERANDS as used. */
if (code != ASM_OPERANDS || MEM_VOLATILE_P (x))
- free_EXPR_LIST_list (&pbi->mem_set_list);
+ {
+ free_EXPR_LIST_list (&pbi->mem_set_list);
+ pbi->mem_set_list_len = 0;
+ }
/* For all ASM_OPERANDS, we must traverse the vector of input operands.
We can not just fall through here since then we would be confused
OpenPOWER on IntegriCloud