OSDN Git Service

* arm.c (arm_handle_notshared_attribute): Wrap declaration and use
[pf3gnuchains/gcc-fork.git] / gcc / local-alloc.c
index 0718f9e..42b9838 100644 (file)
@@ -484,7 +484,7 @@ validate_equiv_mem (rtx start, rtx reg, rtx memref)
       if (find_reg_note (insn, REG_DEAD, reg))
        return 1;
 
-      if (GET_CODE (insn) == CALL_INSN && ! RTX_UNCHANGING_P (memref)
+      if (CALL_P (insn) && ! MEM_READONLY_P (memref)
          && ! CONST_OR_PURE_CALL_P (insn))
        return 0;
 
@@ -518,10 +518,7 @@ equiv_init_varies_p (rtx x)
   switch (code)
     {
     case MEM:
-      return ! RTX_UNCHANGING_P (x) || equiv_init_varies_p (XEXP (x, 0));
-
-    case QUEUED:
-      return 1;
+      return !MEM_READONLY_P (x) || equiv_init_varies_p (XEXP (x, 0));
 
     case CONST:
     case CONST_INT:
@@ -985,7 +982,7 @@ update_equiv_regs (void)
                    if (REG_N_REFS (regno) == 2
                        && (rtx_equal_p (XEXP (note, 0), src)
                            || ! equiv_init_varies_p (src))
-                       && GET_CODE (insn) == INSN
+                       && NONJUMP_INSN_P (insn)
                        && equiv_init_movable_p (PATTERN (insn), regno))
                      reg_equiv[regno].replace = 1;
                }
@@ -1013,6 +1010,11 @@ update_equiv_regs (void)
          if (! INSN_P (insn))
            continue;
 
+         /* Don't substitute into a non-local goto, this confuses CFG.  */
+         if (JUMP_P (insn)
+             && find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
+           continue;
+
          for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
            {
              if (REG_NOTE_KIND (link) == REG_DEAD
@@ -1116,7 +1118,8 @@ update_equiv_regs (void)
   /* Clear all dead REGNOs from all basic block's live info.  */
   if (clear_regnos)
     {
-      int j;
+      unsigned j;
+      
       if (clear_regnos > 8)
        {
          FOR_EACH_BB (bb)
@@ -1126,14 +1129,17 @@ update_equiv_regs (void)
            }
        }
       else
-       EXECUTE_IF_SET_IN_REG_SET (&cleared_regs, 0, j,
-         {
-           FOR_EACH_BB (bb)
-             {
-               CLEAR_REGNO_REG_SET (bb->global_live_at_start, j);
-               CLEAR_REGNO_REG_SET (bb->global_live_at_end, j);
-             }
-         });
+       {
+         reg_set_iterator rsi;
+         EXECUTE_IF_SET_IN_REG_SET (&cleared_regs, 0, j, rsi)
+           {
+             FOR_EACH_BB (bb)
+               {
+                 CLEAR_REGNO_REG_SET (bb->global_live_at_start, j);
+                 CLEAR_REGNO_REG_SET (bb->global_live_at_end, j);
+               }
+           }
+       }
     }
 
   /* Clean up.  */
@@ -1190,7 +1196,7 @@ block_alloc (int b)
   insn = BB_END (BASIC_BLOCK (b));
   while (1)
     {
-      if (GET_CODE (insn) != NOTE)
+      if (!NOTE_P (insn))
        if (++insn_count > max_uid)
          abort ();
       if (insn == BB_HEAD (BASIC_BLOCK (b)))
@@ -1213,7 +1219,7 @@ block_alloc (int b)
   insn = BB_HEAD (BASIC_BLOCK (b));
   while (1)
     {
-      if (GET_CODE (insn) != NOTE)
+      if (!NOTE_P (insn))
        insn_number++;
 
       if (INSN_P (insn))
@@ -1353,7 +1359,7 @@ block_alloc (int b)
                  REG_P (r0))
              && (link = find_reg_note (insn, REG_LIBCALL, NULL_RTX)) != 0
              && XEXP (link, 0) != 0
-             && GET_CODE (XEXP (link, 0)) == INSN
+             && NONJUMP_INSN_P (XEXP (link, 0))
              && (set = single_set (XEXP (link, 0))) != 0
              && SET_DEST (set) == r0 && SET_SRC (set) == r0
              && (note = find_reg_note (XEXP (link, 0), REG_EQUAL,
@@ -1428,7 +1434,7 @@ block_alloc (int b)
             CLOBBER insn, we have reached the end of a REG_NO_CONFLICT
             block, so clear any register number that combined within it.  */
          if ((note = find_reg_note (insn, REG_RETVAL, NULL_RTX)) != 0
-             && GET_CODE (XEXP (note, 0)) == INSN
+             && NONJUMP_INSN_P (XEXP (note, 0))
              && GET_CODE (PATTERN (XEXP (note, 0))) == CLOBBER)
            no_conflict_combined_regno = -1;
        }