summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-25 17:47:26 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-25 17:47:26 +0000
commitea06a3340e0ddabc51ebead5c9167ac1bb366dbd (patch)
treeca6423303b1850aca0173bd4cd22a7d940b9b92e
parentba0688f3de61d72771494c34f7aa8bc5681cb120 (diff)
downloadppe42-gcc-ea06a3340e0ddabc51ebead5c9167ac1bb366dbd.tar.gz
ppe42-gcc-ea06a3340e0ddabc51ebead5c9167ac1bb366dbd.zip
* builtins.c (purge_builtin_constant_p): Scan insn stream
sequentially rather than by basic block. * function.c (purge_addressof): Simplify test with INSN_P. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@61789 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/builtins.c32
-rw-r--r--gcc/function.c3
3 files changed, 20 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f8b02bd5438..dd4a9492fec 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2002-01-25 Roger Sayle <roger@eyesopen.com>
+
+ * builtins.c (purge_builtin_constant_p): Scan insn stream
+ sequentially rather than by basic block.
+ * function.c (purge_addressof): Simplify test with INSN_P.
+
2003-01-25 Kazu Hirata <kazu@cs.umass.edu>
* combine.c (simplify_comparison, case AND): Remove a redundant
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 95f9494e242..d7d8054d539 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4720,26 +4720,20 @@ default_expand_builtin (exp, target, subtarget, mode, ignore)
void
purge_builtin_constant_p ()
{
- rtx insn, done, set;
- rtx arg, new, note;
- basic_block bb;
+ rtx insn, set, arg, new, note;
- FOR_EACH_BB (bb)
- {
- done = NEXT_INSN (bb->end);
- for (insn = bb->head; insn != done; insn = NEXT_INSN (insn))
- if (INSN_P (insn)
- && (set = single_set (insn)) != NULL_RTX
- && GET_CODE (SET_SRC (set)) == CONSTANT_P_RTX)
- {
- arg = XEXP (SET_SRC (set), 0);
- new = CONSTANT_P (arg) ? const1_rtx : const0_rtx;
- validate_change (insn, &SET_SRC (set), new, 0);
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ if (INSN_P (insn)
+ && (set = single_set (insn)) != NULL_RTX
+ && GET_CODE (SET_SRC (set)) == CONSTANT_P_RTX)
+ {
+ arg = XEXP (SET_SRC (set), 0);
+ new = CONSTANT_P (arg) ? const1_rtx : const0_rtx;
+ validate_change (insn, &SET_SRC (set), new, 0);
- /* Remove the REG_EQUAL note from the insn. */
- if ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0)
- remove_note (insn, note);
- }
- }
+ /* Remove the REG_EQUAL note from the insn. */
+ if ((note = find_reg_note (insn, REG_EQUAL, NULL_RTX)) != 0)
+ remove_note (insn, note);
+ }
}
diff --git a/gcc/function.c b/gcc/function.c
index 9e907ea3109..c57ad6dc659 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -3372,8 +3372,7 @@ purge_addressof (insns)
compute_insns_for_mem (insns, NULL_RTX, ht);
for (insn = insns; insn; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN
- || GET_CODE (insn) == CALL_INSN)
+ if (INSN_P (insn))
{
if (! purge_addressof_1 (&PATTERN (insn), insn,
asm_noperands (PATTERN (insn)) > 0, 0, ht))
OpenPOWER on IntegriCloud