OSDN Git Service

* init.c (build_new): Allow enumeration types for the array-bounds
[pf3gnuchains/gcc-fork.git] / gcc / expr.c
index a4637ab..f4ff9b2 100644 (file)
@@ -39,7 +39,6 @@ Boston, MA 02111-1307, USA.  */
 #include "reload.h"
 #include "output.h"
 #include "typeclass.h"
-#include "defaults.h"
 #include "toplev.h"
 #include "ggc.h"
 #include "intl.h"
@@ -1857,6 +1856,9 @@ move_block_from_reg (regno, x, nregs, size)
 #endif
   enum machine_mode mode;
 
+  if (nregs == 0)
+    return;
+
   /* If SIZE is that of a mode no bigger than a word, just use that
      mode's store operation.  */
   if (size <= UNITS_PER_WORD
@@ -2706,6 +2708,8 @@ emit_move_insn (x, y)
      rtx x, y;
 {
   enum machine_mode mode = GET_MODE (x);
+  rtx y_cst = NULL_RTX;
+  rtx last_insn;
 
   x = protect_from_queue (x, 1);
   y = protect_from_queue (y, 0);
@@ -2717,7 +2721,10 @@ emit_move_insn (x, y)
   if (GET_CODE (y) == CONSTANT_P_RTX)
     ;
   else if (CONSTANT_P (y) && ! LEGITIMATE_CONSTANT_P (y))
-    y = force_const_mem (mode, y);
+    {
+      y_cst = y;
+      y = force_const_mem (mode, y);
+    }
 
   /* If X or Y are memory references, verify that their addresses are valid
      for the machine.  */
@@ -2737,7 +2744,13 @@ emit_move_insn (x, y)
   if (mode == BLKmode)
     abort ();
 
-  return emit_move_insn_1 (x, y);
+  last_insn = emit_move_insn_1 (x, y);
+
+  if (y_cst && GET_CODE (x) == REG)
+    REG_NOTES (last_insn)
+      = gen_rtx_EXPR_LIST (REG_EQUAL, y_cst, REG_NOTES (last_insn));
+
+  return last_insn;
 }
 
 /* Low level part of emit_move_insn.
@@ -4785,6 +4798,7 @@ store_constructor (exp, target, align, cleared, size)
              store_constructor_field (target, bitsize, bitpos, mode, value,
                                       type, align, cleared,
                                       TYPE_NONALIASED_COMPONENT (type)
+                                      && GET_CODE (target) == MEM
                                       ? MEM_ALIAS_SET (target) :
                                       get_alias_set (elttype));
 
@@ -5405,10 +5419,10 @@ get_memory_usage_from_modifier (modifier)
     }
 }
 \f
-/* Given an rtx VALUE that may contain additions and multiplications,
-   return an equivalent value that just refers to a register or memory.
-   This is done by generating instructions to perform the arithmetic
-   and returning a pseudo-register containing the value.
+/* Given an rtx VALUE that may contain additions and multiplications, return
+   an equivalent value that just refers to a register, memory, or constant.
+   This is done by generating instructions to perform the arithmetic and
+   returning a pseudo-register containing the value.
 
    The returned value may be a REG, SUBREG, MEM or constant.  */
 
@@ -5817,6 +5831,7 @@ var_rtx (exp)
 }
 
 #ifdef MAX_INTEGER_COMPUTATION_MODE
+
 void
 check_max_integer_computation_mode (exp)
      tree exp;
@@ -5842,7 +5857,7 @@ check_max_integer_computation_mode (exp)
       mode = TYPE_MODE (TREE_TYPE (exp));
       if (GET_MODE_CLASS (mode) == MODE_INT
          && mode > MAX_INTEGER_COMPUTATION_MODE)
-       fatal ("unsupported wide integer operation");
+       internal_error ("unsupported wide integer operation");
     }
 
   /* Check operand of a unary op.  */
@@ -5851,7 +5866,7 @@ check_max_integer_computation_mode (exp)
       mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
       if (GET_MODE_CLASS (mode) == MODE_INT
          && mode > MAX_INTEGER_COMPUTATION_MODE)
-       fatal ("unsupported wide integer operation");
+       internal_error ("unsupported wide integer operation");
     }
 
   /* Check operands of a binary/comparison op.  */
@@ -5860,12 +5875,12 @@ check_max_integer_computation_mode (exp)
       mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
       if (GET_MODE_CLASS (mode) == MODE_INT
          && mode > MAX_INTEGER_COMPUTATION_MODE)
-       fatal ("unsupported wide integer operation");
+       internal_error ("unsupported wide integer operation");
 
       mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1)));
       if (GET_MODE_CLASS (mode) == MODE_INT
          && mode > MAX_INTEGER_COMPUTATION_MODE)
-       fatal ("unsupported wide integer operation");
+       internal_error ("unsupported wide integer operation");
     }
 }
 #endif
@@ -6023,7 +6038,7 @@ expand_expr (exp, target, tmode, modifier)
 
       if (GET_MODE_CLASS (mode) == MODE_INT
          && mode > MAX_INTEGER_COMPUTATION_MODE)
-       fatal ("unsupported wide integer operation");
+       internal_error ("unsupported wide integer operation");
     }
 
   if (tmode != mode
@@ -6038,7 +6053,7 @@ expand_expr (exp, target, tmode, modifier)
       && TREE_CODE (exp) != RTL_EXPR
       && GET_MODE_CLASS (tmode) == MODE_INT
       && tmode > MAX_INTEGER_COMPUTATION_MODE)
-    fatal ("unsupported wide integer operation");
+    internal_error ("unsupported wide integer operation");
 
   check_max_integer_computation_mode (exp);
 #endif