OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / jump.c
index e17f148..bacb7f4 100644 (file)
@@ -122,8 +122,10 @@ cleanup_barriers (void)
   return 0;
 }
 
-struct tree_opt_pass pass_cleanup_barriers =
+struct rtl_opt_pass pass_cleanup_barriers =
 {
+ {
+  RTL_PASS,
   "barriers",                           /* name */
   NULL,                                 /* gate */
   cleanup_barriers,                     /* execute */
@@ -135,8 +137,8 @@ struct tree_opt_pass pass_cleanup_barriers =
   0,                                    /* properties_provided */
   0,                                    /* properties_destroyed */
   0,                                    /* todo_flags_start */
-  TODO_dump_func,                       /* todo_flags_finish */
-  0                                     /* letter */
+  TODO_dump_func                        /* todo_flags_finish */
+ }
 };
 
 \f
@@ -349,7 +351,7 @@ reversed_comparison_code_parts (enum rtx_code code, const_rtx arg0,
        return UNKNOWN;
 
       /* These CONST_CAST's are okay because prev_nonnote_insn just
-        returns it's argument and we assign it to a const_rtx
+        returns its argument and we assign it to a const_rtx
         variable.  */
       for (prev = prev_nonnote_insn (CONST_CAST_RTX(insn));
           prev != 0 && !LABEL_P (prev);
@@ -1051,6 +1053,9 @@ mark_jump_label_1 (rtx x, rtx insn, bool in_mem, bool is_target)
        if (insn)
          {
            if (is_target
+               /* Do not change a previous setting of JUMP_LABEL.  If the
+                  JUMP_LABEL slot is occupied by a different label,
+                  create a note for this label.  */
                && (JUMP_LABEL (insn) == NULL || JUMP_LABEL (insn) == label))
              JUMP_LABEL (insn) = label;
            else
@@ -1063,8 +1068,7 @@ mark_jump_label_1 (rtx x, rtx insn, bool in_mem, bool is_target)
                   a label, except for the primary target of a jump,
                   must have such a note.  */
                if (! find_reg_note (insn, kind, label))
-                 REG_NOTES (insn)
-                   = gen_rtx_INSN_LIST (kind, label, REG_NOTES (insn));
+                 add_reg_note (insn, kind, label);
              }
          }
        return;
@@ -1322,6 +1326,15 @@ redirect_exp_1 (rtx *loc, rtx olabel, rtx nlabel, rtx insn)
       return;
     }
 
+  if (code == IF_THEN_ELSE)
+    {
+      /* Skip the condition of an IF_THEN_ELSE.  We only want to
+         change jump destinations, not eventual label comparisons.  */
+      redirect_exp_1 (&XEXP (x, 1), olabel, nlabel, insn);
+      redirect_exp_1 (&XEXP (x, 2), olabel, nlabel, insn);
+      return;
+    }
+
   fmt = GET_RTX_FORMAT (code);
   for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
     {
@@ -1539,12 +1552,22 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
 
          if (reg_renumber[reg_x] >= 0)
            {
+             if (!subreg_offset_representable_p (reg_renumber[reg_x],
+                                                 GET_MODE (SUBREG_REG (x)),
+                                                 byte_x,
+                                                 GET_MODE (x)))
+               return 0;
              reg_x = subreg_regno_offset (reg_renumber[reg_x],
                                           GET_MODE (SUBREG_REG (x)),
                                           byte_x,
                                           GET_MODE (x));
              byte_x = 0;
            }
+         else if (!subreg_offset_representable_p (reg_x,
+                                                  GET_MODE (SUBREG_REG (x)),
+                                                  byte_x,
+                                                  GET_MODE (x)))
+           return 0;
        }
       else
        {
@@ -1560,12 +1583,22 @@ rtx_renumbered_equal_p (const_rtx x, const_rtx y)
 
          if (reg_renumber[reg_y] >= 0)
            {
+             if (!subreg_offset_representable_p (reg_renumber[reg_y],
+                                                 GET_MODE (SUBREG_REG (y)),
+                                                 byte_y,
+                                                 GET_MODE (y)))
+               return 0;
              reg_y = subreg_regno_offset (reg_renumber[reg_y],
                                           GET_MODE (SUBREG_REG (y)),
                                           byte_y,
                                           GET_MODE (y));
              byte_y = 0;
            }
+         else if (!subreg_offset_representable_p (reg_y,
+                                                  GET_MODE (SUBREG_REG (y)),
+                                                  byte_y,
+                                                  GET_MODE (y)))
+           return 0;
        }
       else
        {