OSDN Git Service

Index: gcc/ChangeLog
[pf3gnuchains/gcc-fork.git] / gcc / ifcvt.c
index d969104..2939de4 100644 (file)
@@ -580,8 +580,7 @@ noce_emit_move_insn (x, y)
   outmode = GET_MODE (outer);
   inmode = GET_MODE (inner);
   bitpos = SUBREG_BYTE (outer) * BITS_PER_UNIT;
-  store_bit_field (inner, GET_MODE_BITSIZE (outmode),
-                  bitpos, outmode, y, GET_MODE_BITSIZE (inmode),
+  store_bit_field (inner, GET_MODE_BITSIZE (outmode), bitpos, outmode, y,
                   GET_MODE_BITSIZE (inmode));
 }
 
@@ -651,6 +650,12 @@ noce_try_store_flag_constants (if_info)
       mode = GET_MODE (if_info->x);
       ifalse = INTVAL (if_info->a);
       itrue = INTVAL (if_info->b);
+
+      /* Make sure we can represent the difference between the two values.  */
+      if ((itrue - ifalse > 0)
+         != ((ifalse < 0) != (itrue < 0) ? ifalse < 0 : ifalse < itrue))
+       return FALSE;
+
       diff = trunc_int_for_mode (itrue - ifalse, mode);
 
       can_reverse = (reversed_comparison_code (if_info->cond, if_info->jump)
@@ -2532,7 +2537,7 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
              /* ??? Even non-trapping memories such as stack frame
                 references must be avoided.  For stores, we collect
                 no lifetime info; for reads, we'd have to assert
-                true_dependance false against every store in the
+                true_dependence false against every store in the
                 TEST range.  */
              if (for_each_rtx (&PATTERN (insn), find_memory, NULL))
                return FALSE;
@@ -2652,6 +2657,7 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
       probability = BRANCH_EDGE (test_bb)->probability;
       BRANCH_EDGE (test_bb)->probability = FALLTHRU_EDGE (test_bb)->probability;
       FALLTHRU_EDGE (test_bb)->probability = probability;
+      update_br_prob_note (test_bb);
     }
 
   /* Move the insns out of MERGE_BB to before the branch.  */
@@ -2660,7 +2666,8 @@ dead_or_predicable (test_bb, merge_bb, other_bb, new_dest, reversep)
       if (end == merge_bb->end)
        merge_bb->end = PREV_INSN (head);
 
-      squeeze_notes (&head, &end);
+      if (squeeze_notes (&head, &end))
+       return TRUE;
 
       reorder_insns (head, end, PREV_INSN (earliest));
     }