OSDN Git Service

PR tree-opt/18607
[pf3gnuchains/gcc-fork.git] / gcc / explow.c
index f58873a..a3e28ff 100644 (file)
@@ -50,8 +50,7 @@ trunc_int_for_mode (HOST_WIDE_INT c, enum machine_mode mode)
   int width = GET_MODE_BITSIZE (mode);
 
   /* You want to truncate to a _what_?  */
-  if (! SCALAR_INT_MODE_P (mode))
-    abort ();
+  gcc_assert (SCALAR_INT_MODE_P (mode));
 
   /* Canonicalize BImode to 0 and STORE_FLAG_VALUE.  */
   if (mode == BImode)
@@ -577,34 +576,6 @@ validize_mem (rtx ref)
   return replace_equiv_address (ref, XEXP (ref, 0));
 }
 \f
-/* Given REF, either a MEM or a REG, and T, either the type of X or
-   the expression corresponding to REF, set RTX_UNCHANGING_P if
-   appropriate.  */
-
-void
-maybe_set_unchanging (rtx ref, tree t)
-{
-  /* We can set RTX_UNCHANGING_P from TREE_READONLY for decls whose
-     initialization is only executed once, or whose initializer always
-     has the same value.  Currently we simplify this to PARM_DECLs in the
-     first case, and decls with TREE_CONSTANT initializers in the second.
-
-     We cannot do this for non-static aggregates, because of the double
-     writes that can be generated by store_constructor, depending on the
-     contents of the initializer.  Yes, this does eliminate a good fraction
-     of the number of uses of RTX_UNCHANGING_P for a language like Ada.
-     It also eliminates a good quantity of bugs.  Let this be incentive to
-     eliminate RTX_UNCHANGING_P entirely in favor of a more reliable
-     solution, perhaps based on alias sets.  */
-
-  if ((TREE_READONLY (t) && DECL_P (t)
-       && (TREE_STATIC (t) || ! AGGREGATE_TYPE_P (TREE_TYPE (t)))
-       && (TREE_CODE (t) == PARM_DECL
-          || (DECL_INITIAL (t) && TREE_CONSTANT (DECL_INITIAL (t)))))
-      || TREE_CODE_CLASS (TREE_CODE (t)) == 'c')
-    RTX_UNCHANGING_P (ref) = 1;
-}
-\f
 /* Return a modified copy of X with its memory address copied
    into a temporary register to protect it from side effects.
    If X is not a MEM, it is returned unchanged (and not copied).
@@ -661,8 +632,7 @@ copy_to_mode_reg (enum machine_mode mode, rtx x)
   if (! general_operand (x, VOIDmode))
     x = force_operand (x, temp);
 
-  if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode)
-    abort ();
+  gcc_assert (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode);
   if (x != temp)
     emit_move_insn (temp, x);
   return temp;
@@ -905,7 +875,7 @@ anti_adjust_stack (rtx adjust)
 /* Round the size of a block to be pushed up to the boundary required
    by this machine.  SIZE is the desired size, which need not be constant.  */
 
-rtx
+static rtx
 round_push (rtx size)
 {
   int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
@@ -995,6 +965,7 @@ emit_stack_save (enum save_level save_level, rtx *psave, rtx after)
       rtx seq;
 
       start_sequence ();
+      do_pending_stack_adjust ();
       /* We must validize inside the sequence, to ensure that any instructions
         created by the validize call also get moved to the right place.  */
       if (sa != 0)
@@ -1006,6 +977,7 @@ emit_stack_save (enum save_level save_level, rtx *psave, rtx after)
     }
   else
     {
+      do_pending_stack_adjust ();
       if (sa != 0)
        sa = validize_mem (sa);
       emit_insn (fcn (sa, stack_pointer_rtx));
@@ -1062,6 +1034,8 @@ emit_stack_restore (enum save_level save_level, rtx sa, rtx after)
                    gen_rtx_MEM (BLKmode, stack_pointer_rtx)));
     }
 
+  discard_pending_stack_adjust ();
+
   if (after)
     {
       rtx seq;
@@ -1134,11 +1108,10 @@ optimize_save_area_alloca (void)
 
                 Right now only supported port with stack that grow upward
                 is the HPPA and it does not define SETJMP_VIA_SAVE_AREA.  */
-             if (GET_CODE (pat) != SET
-                 || SET_DEST (pat) != stack_pointer_rtx
-                 || GET_CODE (SET_SRC (pat)) != MINUS
-                 || XEXP (SET_SRC (pat), 0) != stack_pointer_rtx)
-               abort ();
+             gcc_assert (GET_CODE (pat) == SET
+                         && SET_DEST (pat) == stack_pointer_rtx
+                         && GET_CODE (SET_SRC (pat)) == MINUS
+                         && XEXP (SET_SRC (pat), 0) == stack_pointer_rtx);
 
              /* This will now be transformed into a (set REG REG)
                 so we can just blow away all the other notes.  */
@@ -1162,8 +1135,7 @@ optimize_save_area_alloca (void)
                    if (XEXP (srch, 1) == note)
                      break;
 
-                 if (srch == NULL_RTX)
-                   abort ();
+                 gcc_assert (srch);
 
                  XEXP (srch, 1) = XEXP (note, 1);
                }
@@ -1257,8 +1229,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
 
        /* ??? Code below assumes that the save area needs maximal
           alignment.  This constraint may be too strong.  */
-       if (PREFERRED_STACK_BOUNDARY != BIGGEST_ALIGNMENT)
-         abort ();
+       gcc_assert (PREFERRED_STACK_BOUNDARY == BIGGEST_ALIGNMENT);
 
        if (GET_CODE (size) == CONST_INT)
          {
@@ -1315,8 +1286,8 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align)
 
  /* We ought to be called always on the toplevel and stack ought to be aligned
     properly.  */
-  if (stack_pointer_delta % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT))
-    abort ();
+  gcc_assert (!(stack_pointer_delta
+               % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT)));
 
   /* If needed, check that we have the required amount of stack.  Take into
      account what has already been checked.  */
@@ -1567,8 +1538,7 @@ probe_stack_range (HOST_WIDE_INT first, rtx size)
                           1, OPTAB_WIDEN);
 #endif
 
-      if (temp != test_addr)
-       abort ();
+      gcc_assert (temp == test_addr);
 
       emit_label (test_lab);
       emit_cmp_and_jump_insns (test_addr, last_addr, CMP_OPCODE,
@@ -1622,8 +1592,7 @@ hard_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
        }
 
       /* No suitable mode found.  */
-      if (tmpmode == VOIDmode)
-       abort ();
+      gcc_assert (tmpmode != VOIDmode);
 
       PUT_MODE (val, tmpmode);
     }