OSDN Git Service

2003-07-30 Chris Demetriou <cgd@broadcom.com>
[pf3gnuchains/gcc-fork.git] / gcc / expr.c
index 80efb3f..f95678f 100644 (file)
@@ -339,7 +339,7 @@ init_expr_once (void)
 void
 init_expr (void)
 {
-  cfun->expr = (struct expr_status *) ggc_alloc (sizeof (struct expr_status));
+  cfun->expr = ggc_alloc (sizeof (struct expr_status));
 
   pending_chain = 0;
   pending_stack_adjust = 0;
@@ -1766,6 +1766,9 @@ emit_block_move (rtx x, rtx y, rtx size, enum block_op_methods method)
      can be incorrect is coming from __builtin_memcpy.  */
   if (GET_CODE (size) == CONST_INT)
     {
+      if (INTVAL (size) == 0)
+       return 0;
+
       x = shallow_copy_rtx (x);
       y = shallow_copy_rtx (y);
       set_mem_size (x, size);
@@ -2221,7 +2224,7 @@ gen_group_rtx (rtx orig)
     abort ();
 
   length = XVECLEN (orig, 0);
-  tmps = (rtx *) alloca (sizeof (rtx) * length);
+  tmps = alloca (sizeof (rtx) * length);
 
   /* Skip a NULL entry in first slot.  */
   i = XEXP (XVECEXP (orig, 0, 0), 0) ? 0 : 1;
@@ -2261,7 +2264,7 @@ emit_group_load (rtx dst, rtx orig_src, tree type ATTRIBUTE_UNUSED, int ssize)
   else
     start = 1;
 
-  tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (dst, 0));
+  tmps = alloca (sizeof (rtx) * XVECLEN (dst, 0));
 
   /* Process the pieces.  */
   for (i = start; i < XVECLEN (dst, 0); i++)
@@ -2418,7 +2421,7 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
   else
     start = 1;
 
-  tmps = (rtx *) alloca (sizeof (rtx) * XVECLEN (src, 0));
+  tmps = alloca (sizeof (rtx) * XVECLEN (src, 0));
 
   /* Copy the (probable) hard regs into pseudos.  */
   for (i = start; i < XVECLEN (src, 0); i++)
@@ -2975,7 +2978,7 @@ clear_storage (rtx object, rtx size)
       object = protect_from_queue (object, 1);
       size = protect_from_queue (size, 0);
 
-      if (GET_CODE (size) == CONST_INT && INTVAL (size) == 0)
+      if (size == const0_rtx)
        ;
       else if (GET_CODE (size) == CONST_INT
          && CLEAR_BY_PIECES_P (INTVAL (size), align))
@@ -4128,16 +4131,10 @@ get_subtarget (rtx x)
    If WANT_VALUE is nonzero, return an rtx for the value of TO.
    (This may contain a QUEUED rtx;
    if the value is constant, this rtx is a constant.)
-   Otherwise, the returned value is NULL_RTX.
-
-   SUGGEST_REG is no longer actually used.
-   It used to mean, copy the value through a register
-   and return that register, if that is possible.
-   We now use WANT_VALUE to decide whether to do this.  */
+   Otherwise, the returned value is NULL_RTX.  */
 
 rtx
-expand_assignment (tree to, tree from, int want_value,
-                  int suggest_reg ATTRIBUTE_UNUSED)
+expand_assignment (tree to, tree from, int want_value)
 {
   rtx to_rtx = 0;
   rtx result;
@@ -5391,7 +5388,7 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
        {
          unsigned int set_word_size = TYPE_ALIGN (TREE_TYPE (exp));
          enum machine_mode mode = mode_for_size (set_word_size, MODE_INT, 1);
-         char *bit_buffer = (char *) alloca (nbits);
+         char *bit_buffer = alloca (nbits);
          HOST_WIDE_INT word = 0;
          unsigned int bit_pos = 0;
          unsigned int ibit = 0;
@@ -6266,10 +6263,6 @@ safe_from_p (rtx x, tree exp, int top_p)
             part of the expression.  */
          return safe_from_p (x, TREE_OPERAND (exp, 1), 0);
 
-       case METHOD_CALL_EXPR:
-         /* This takes an rtx argument, but shouldn't appear here.  */
-         abort ();
-
        default:
          break;
        }
@@ -6741,7 +6734,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
     case PARM_DECL:
       if (!DECL_RTL_SET_P (exp))
        {
-         error_with_decl (exp, "prior parameter's size depends on `%s'");
+         error ("%Hprior parameter's size depends on '%D'",
+                 &DECL_SOURCE_LOCATION (exp), exp);
          return CONST0_RTX (mode);
        }
 
@@ -9144,7 +9138,7 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
        tree lhs = TREE_OPERAND (exp, 0);
        tree rhs = TREE_OPERAND (exp, 1);
 
-       temp = expand_assignment (lhs, rhs, ! ignore, original_target != 0);
+       temp = expand_assignment (lhs, rhs, ! ignore);
        return temp;
       }
 
@@ -9189,13 +9183,13 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode, enum expand_modifier
                                             (TREE_CODE (rhs) == BIT_IOR_EXPR
                                              ? integer_one_node
                                              : integer_zero_node)),
-                              0, 0);
+                              0);
            do_pending_stack_adjust ();
            emit_label (label);
            return const0_rtx;
          }
 
-       temp = expand_assignment (lhs, rhs, ! ignore, original_target != 0);
+       temp = expand_assignment (lhs, rhs, ! ignore);
 
        return temp;
       }
@@ -9798,7 +9792,7 @@ expand_increment (tree exp, int post, int ignore)
          incremented = TREE_OPERAND (incremented, 0);
        }
 
-      temp = expand_assignment (incremented, newexp, ! post && ! ignore , 0);
+      temp = expand_assignment (incremented, newexp, ! post && ! ignore);
       return post ? op0 : temp;
     }