OSDN Git Service

Move constructor/destructor handling into target hooks.
[pf3gnuchains/gcc-fork.git] / gcc / explow.c
index bf5eb89..9f2357a 100644 (file)
@@ -78,7 +78,7 @@ plus_constant_wide (x, c)
      register HOST_WIDE_INT c;
 {
   register RTX_CODE code;
-  rtx y = x;
+  rtx y;
   register enum machine_mode mode;
   register rtx tem;
   int all_constant = 0;
@@ -90,6 +90,8 @@ plus_constant_wide (x, c)
 
   code = GET_CODE (x);
   mode = GET_MODE (x);
+  y = x;
+
   switch (code)
     {
     case CONST_INT:
@@ -178,11 +180,6 @@ plus_constant_wide (x, c)
        }
       break;
 
-    case LO_SUM:
-      return gen_rtx_LO_SUM (mode, XEXP (x, 0),
-                            plus_constant (XEXP (x, 1), c));
-
-      
     default:
       break;
     }
@@ -368,25 +365,36 @@ convert_memory_address (to_mode, x)
       return x;
 
     case SUBREG:
-      if (GET_MODE (SUBREG_REG (x)) == to_mode)
+      if (POINTERS_EXTEND_UNSIGNED >= 0
+         && GET_MODE (SUBREG_REG (x)) == to_mode)
        return SUBREG_REG (x);
       break;
 
     case LABEL_REF:
-      temp = gen_rtx_LABEL_REF (to_mode, XEXP (x, 0));
-      LABEL_REF_NONLOCAL_P (temp) = LABEL_REF_NONLOCAL_P (x);
-      return temp;
+      if (POINTERS_EXTEND_UNSIGNED >= 0)
+       {
+         temp = gen_rtx_LABEL_REF (to_mode, XEXP (x, 0));
+         LABEL_REF_NONLOCAL_P (temp) = LABEL_REF_NONLOCAL_P (x);
+         return temp;
+       }
+      break;
 
     case SYMBOL_REF:
-      temp = gen_rtx_SYMBOL_REF (to_mode, XSTR (x, 0));
-      SYMBOL_REF_FLAG (temp) = SYMBOL_REF_FLAG (x);
-      CONSTANT_POOL_ADDRESS_P (temp) = CONSTANT_POOL_ADDRESS_P (x);
-      STRING_POOL_ADDRESS_P (temp) = STRING_POOL_ADDRESS_P (x);
-      return temp;
+      if (POINTERS_EXTEND_UNSIGNED >= 0)
+       {
+         temp = gen_rtx_SYMBOL_REF (to_mode, XSTR (x, 0));
+         SYMBOL_REF_FLAG (temp) = SYMBOL_REF_FLAG (x);
+         CONSTANT_POOL_ADDRESS_P (temp) = CONSTANT_POOL_ADDRESS_P (x);
+         STRING_POOL_ADDRESS_P (temp) = STRING_POOL_ADDRESS_P (x);
+         return temp;
+       }
+      break;
 
     case CONST:
-      return gen_rtx_CONST (to_mode, 
-                           convert_memory_address (to_mode, XEXP (x, 0)));
+      if (POINTERS_EXTEND_UNSIGNED >= 0)
+        return gen_rtx_CONST (to_mode, 
+                             convert_memory_address (to_mode, XEXP (x, 0)));
+      break;
 
     case PLUS:
     case MULT:
@@ -394,10 +402,11 @@ convert_memory_address (to_mode, x)
         permute the conversion and addition operation.  We can always safely
         permute them if we are making the address narrower.  In addition,
         always permute the operations if this is a constant.  */
-      if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
-         || (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT
-             && (INTVAL (XEXP (x, 1)) + 20000 < 40000
-                 || CONSTANT_P (XEXP (x, 0)))))
+      if (POINTERS_EXTEND_UNSIGNED >= 0
+         && (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
+             || (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT
+                 && (INTVAL (XEXP (x, 1)) + 20000 < 40000
+                     || CONSTANT_P (XEXP (x, 0))))))
        return gen_rtx_fmt_ee (GET_CODE (x), to_mode, 
                               convert_memory_address (to_mode, XEXP (x, 0)),
                               convert_memory_address (to_mode, XEXP (x, 1)));
@@ -608,10 +617,12 @@ validize_mem (ref)
 {
   if (GET_CODE (ref) != MEM)
     return ref;
-  if (memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
+  if (! (flag_force_addr && CONSTANT_ADDRESS_P (XEXP (ref, 0)))
+      && memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
     return ref;
+
   /* Don't alter REF itself, since that is probably a stack slot.  */
-  return change_address (ref, GET_MODE (ref), XEXP (ref, 0));
+  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
@@ -662,12 +673,12 @@ set_mem_attributes (ref, t, objectp)
      here, because, in C and C++, the fact that a location is accessed
      through a const expression does not mean that the value there can
      never change.  */
-  MEM_ALIAS_SET (ref) = get_alias_set (t);
+  set_mem_alias_set (ref, get_alias_set (t));
   MEM_VOLATILE_P (ref) = TYPE_VOLATILE (type);
   MEM_IN_STRUCT_P (ref) = AGGREGATE_TYPE_P (type);
 
   /* If we are making an object of this type, we know that it is a scalar if
-     the type is not an aggregate. */
+     the type is not an aggregate.  */
   if (objectp && ! AGGREGATE_TYPE_P (type))
     MEM_SCALAR_P (ref) = 1;
 
@@ -711,21 +722,13 @@ rtx
 stabilize (x)
      rtx x;
 {
-  register rtx addr;
 
-  if (GET_CODE (x) != MEM)
+  if (GET_CODE (x) != MEM
+      || ! rtx_unstable_p (XEXP (x, 0)))
     return x;
 
-  addr = XEXP (x, 0);
-  if (rtx_unstable_p (addr))
-    {
-      rtx temp = force_reg (Pmode, copy_all_regs (addr));
-      rtx mem = gen_rtx_MEM (GET_MODE (x), temp);
-
-      MEM_COPY_ATTRIBUTES (mem, x);
-      return mem;
-    }
-  return x;
+  return
+    replace_equiv_address (x, force_reg (Pmode, copy_all_regs (XEXP (x, 0))));
 }
 \f
 /* Copy the value or contents of X to a new temp reg and return that reg.  */
@@ -1660,7 +1663,7 @@ probe_stack_range (first, size)
    otherwise 0.
    OUTGOING is 1 if on a machine with register windows this function
    should return the register in which the function will put its result
-   and 0 otherwise. */
+   and 0 otherwise.  */
 
 rtx
 hard_function_value (valtype, func, outgoing)