builtins.c (purge_builtin_constant_p): Scan insn stream sequentially rather than...
authorRoger Sayle <roger@eyesopen.com>
Sat, 25 Jan 2003 17:47:26 +0000 (17:47 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 25 Jan 2003 17:47:26 +0000 (17:47 +0000)
* builtins.c (purge_builtin_constant_p): Scan insn stream
sequentially rather than by basic block.
* function.c (purge_addressof): Simplify test with INSN_P.

From-SVN: r61789

gcc/ChangeLog
gcc/builtins.c
gcc/function.c

index f8b02bd54382dfe7ca3842a290715d99c4fbb3d2..dd4a9492fec6efc1d952606ae9ee9d5bb1d2f8a2 100644 (file)
@@ -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
index 95f9494e242587ca10e0a23690998d7e9ba29310..d7d8054d539719df73572628135cc9d3a7fc7a46 100644 (file)
@@ -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);
+      }
 }
 
index 9e907ea310978233cb437ead28189f027db693ae..c57ad6dc659314124fe43d68713e05d7e096de92 100644 (file)
@@ -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))