OSDN Git Service

2010-04-19 Martin Jambor <mjambor@suse.cz>
[pf3gnuchains/gcc-fork.git] / gcc / var-tracking.c
index 5e261d6..0c41312 100644 (file)
@@ -614,29 +614,6 @@ insn_stack_adjust_offset_pre_post (rtx insn, HOST_WIDE_INT *pre,
     }
 }
 
-/* Compute stack adjustment in basic block BB.  */
-
-static void
-bb_stack_adjust_offset (basic_block bb)
-{
-  HOST_WIDE_INT offset;
-  unsigned int i;
-  micro_operation *mo;
-
-  offset = VTI (bb)->in.stack_adjust;
-  for (i = 0; VEC_iterate (micro_operation, VTI (bb)->mos, i, mo); i++)
-    {
-      if (mo->type == MO_ADJUST)
-       offset += mo->u.adjust;
-      else if (mo->type != MO_CALL)
-       {
-         if (MEM_P (mo->u.loc))
-           mo->u.loc = adjust_stack_reference (mo->u.loc, -offset);
-       }
-    }
-  VTI (bb)->out.stack_adjust = offset;
-}
-
 /* Compute stack adjustments for all blocks by traversing DFS tree.
    Return true when the adjustments on all incoming edges are consistent.
    Heavily borrowed from pre_and_rev_post_order_compute.  */
@@ -4874,30 +4851,6 @@ log_op_type (rtx x, basic_block bb, rtx insn,
   fputc ('\n', out);
 }
 
-/* Adjust sets if needed.  Currently this optimizes read-only MEM loads
-   if REG_EQUAL/REG_EQUIV note is present.  */
-
-static void
-adjust_sets (rtx insn, struct cselib_set *sets, int n_sets)
-{
-  if (n_sets == 1 && MEM_P (sets[0].src) && MEM_READONLY_P (sets[0].src))
-    {
-      /* For read-only MEMs containing some constant, prefer those
-        constants.  */
-      rtx note = find_reg_equal_equiv_note (insn), src;
-
-      if (note && CONSTANT_P (XEXP (note, 0)))
-       {
-         sets[0].src = src = XEXP (note, 0);
-         if (GET_CODE (PATTERN (insn)) == COND_EXEC)
-           src = gen_rtx_IF_THEN_ELSE (GET_MODE (sets[0].dest),
-                                       COND_EXEC_TEST (PATTERN (insn)),
-                                       src, sets[0].dest);
-         sets[0].src_elt = cselib_lookup (src, GET_MODE (sets[0].dest), 1);
-       }
-    }
-}
-
 /* Tell whether the CONCAT used to holds a VALUE and its location
    needs value resolution, i.e., an attempt of mapping the location
    back to other incoming values.  */
@@ -5260,6 +5213,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
 
   if (REG_P (loc))
     {
+      gcc_assert (loc != cfa_base_rtx);
       if ((GET_CODE (expr) == CLOBBER && type != MO_VAL_SET)
          || !(track_p = use_type (loc, NULL, &mode2) == MO_USE)
          || GET_CODE (expr) == CLOBBER)
@@ -8298,6 +8252,8 @@ vt_initialize (void)
       /* Add the micro-operations to the vector.  */
       FOR_BB_BETWEEN (bb, first_bb, last_bb->next_bb, next_bb)
        {
+         HOST_WIDE_INT offset = VTI (bb)->out.stack_adjust;
+         VTI (bb)->out.stack_adjust = VTI (bb)->in.stack_adjust;
          for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
               insn = NEXT_INSN (insn))
            {
@@ -8312,9 +8268,6 @@ vt_initialize (void)
                          mo.type = MO_ADJUST;
                          mo.u.adjust = pre;
                          mo.insn = insn;
-                         VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
-                                        &mo);
-
                          if (dump_file && (dump_flags & TDF_DETAILS))
                            log_op_type (PATTERN (insn), bb, insn,
                                         MO_ADJUST, dump_file);
@@ -8345,9 +8298,6 @@ vt_initialize (void)
                      mo.type = MO_ADJUST;
                      mo.u.adjust = post;
                      mo.insn = insn;
-                     VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
-                                    &mo);
-
                      if (dump_file && (dump_flags & TDF_DETAILS))
                        log_op_type (PATTERN (insn), bb, insn,
                                     MO_ADJUST, dump_file);
@@ -8366,6 +8316,7 @@ vt_initialize (void)
                    }
                }
            }
+         gcc_assert (offset == VTI (bb)->out.stack_adjust);
        }
 
       bb = last_bb;