OSDN Git Service

(c_sizeof, build_c_cast): Set TREE_OVERFLOW in addition
[pf3gnuchains/gcc-fork.git] / gcc / rtlanal.c
index 8ccae19..549f905 100644 (file)
@@ -528,9 +528,9 @@ single_set (insn)
     {
       for (i = 0, set = 0; i < XVECLEN (PATTERN (insn), 0); i++)
        if (GET_CODE (XVECEXP (PATTERN (insn), 0, i)) == SET
-           && ! (find_reg_note (insn, REG_UNUSED,
-                               SET_DEST (XVECEXP (PATTERN (insn), 0, i)))
-                 || side_effects_p (XVECEXP (PATTERN (insn), 0, i))))
+           && (! find_reg_note (insn, REG_UNUSED,
+                                SET_DEST (XVECEXP (PATTERN (insn), 0, i)))
+               || side_effects_p (XVECEXP (PATTERN (insn), 0, i))))
          {
            if (set)
              return 0;
@@ -779,8 +779,8 @@ reg_set_last_1 (x, pat)
 /* Return the last value to which REG was set prior to INSN.  If we can't
    find it easily, return 0.
 
-   We only return a REG or constant because it is too hard to check if a
-   MEM remains unchanged.  */
+   We only return a REG, SUBREG, or constant because it is too hard to
+   check if a MEM remains unchanged.  */
 
 rtx
 reg_set_last (x, insn)
@@ -805,6 +805,8 @@ reg_set_last (x, insn)
 
      If we find a set of X, ensure that its SET_SRC remains unchanged.  */
 
+  /* We compare with <= here, because reg_set_last_last_regno
+     is actually the number of the first reg *not* in X.  */
   for (;
        insn && GET_CODE (insn) != CODE_LABEL
        && ! (GET_CODE (insn) == CALL_INSN
@@ -818,7 +820,8 @@ reg_set_last (x, insn)
        else if (reg_set_last_value)
          {
            if (CONSTANT_P (reg_set_last_value)
-               || (GET_CODE (reg_set_last_value) == REG
+               || ((GET_CODE (reg_set_last_value) == REG
+                    || GET_CODE (reg_set_last_value) == SUBREG)
                    && ! reg_set_between_p (reg_set_last_value,
                                            NEXT_INSN (insn), orig_insn)))
              return reg_set_last_value;
@@ -1132,7 +1135,9 @@ find_reg_note (insn, kind, datum)
 }
 
 /* Return the reg-note of kind KIND in insn INSN which applies to register
-   number REGNO, if any.  Return 0 if there is no such reg-note.  */
+   number REGNO, if any.  Return 0 if there is no such reg-note.  Note that
+   the REGNO of this NOTE need not be REGNO if REGNO is a hard register;
+   it might be the case that the note overlaps REGNO.  */
 
 rtx
 find_regno_note (insn, kind, regno)
@@ -1147,7 +1152,12 @@ find_regno_note (insn, kind, regno)
        /* Verify that it is a register, so that scratch and MEM won't cause a
           problem here.  */
        && GET_CODE (XEXP (link, 0)) == REG
-       && REGNO (XEXP (link, 0)) == regno)
+       && REGNO (XEXP (link, 0)) <= regno
+       && ((REGNO (XEXP (link, 0))
+            + (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1
+               : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)),
+                                   GET_MODE (XEXP (link, 0)))))
+           > regno))
       return link;
   return 0;
 }