OSDN Git Service

* expr.c (copy_blkmode_from_reg): Add missing braces to eliminate
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Dec 2001 01:37:46 +0000 (01:37 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 Dec 2001 01:37:46 +0000 (01:37 +0000)
warning and reformat comments.
(expand_assignment): Don't pass EXPAND_WRITE if LHS is component.
(highest_pow2_factor, case INTEGER_CST): Return BIGGEST_ALIGNMENT
if overflow.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47983 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/expr.c

index dfb9eff..74563e6 100644 (file)
@@ -1,3 +1,11 @@
+Thu Dec 13 20:30:08 2001  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
+
+       * expr.c (copy_blkmode_from_reg): Add missing braces to eliminate
+       warning and reformat comments.
+       (expand_assignment): Don't pass EXPAND_WRITE if LHS is component.
+       (highest_pow2_factor, case INTEGER_CST): Return BIGGEST_ALIGNMENT
+       if overflow.
+
 2001-12-12  Aldy Hernandez  <aldyh@redhat.com>
 
         * config/rs6000/rs6000.c (rs6000_override_options): Add
index 2561fc3..5884217 100644 (file)
@@ -2163,19 +2163,20 @@ copy_blkmode_from_reg (tgtblk, srcreg, type)
       preserve_temp_slots (tgtblk);
     }
 
-  /* This code assumes srcreg is at least a full word.  If it isn't,
-     copy it into a new pseudo which is a full word.  */
+  /* This code assumes srcreg is at least a full word.  If it isn't, copy it
+     into a new pseudo which is a full word.
 
-  /* If FUNCTION_ARG_REG_LITTLE_ENDIAN is set and convert_to_mode does
-     a copy, the wrong part of the register gets copied so we fake
-     a type conversion in place.  */
-     
+     If FUNCTION_ARG_REG_LITTLE_ENDIAN is set and convert_to_mode does a copy,
+     the wrong part of the register gets copied so we fake a type conversion
+     in place.  */
   if (GET_MODE (srcreg) != BLKmode
       && GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
-    if (FUNCTION_ARG_REG_LITTLE_ENDIAN)
-       srcreg = simplify_gen_subreg (word_mode, srcreg, GET_MODE (srcreg), 0);
-    else
-       srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
+    {
+      if (FUNCTION_ARG_REG_LITTLE_ENDIAN)
+       srcreg = simplify_gen_subreg (word_mode, srcreg, GET_MODE (srcreg), 0);
+      else
+       srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
+    }
 
   /* Structures whose size is not a multiple of a word are aligned
      to the least significant byte (to the right).  On a BYTES_BIG_ENDIAN
@@ -3645,8 +3646,8 @@ expand_assignment (to, from, want_value, suggest_reg)
       if (mode1 == VOIDmode && want_value)
        tem = stabilize_reference (tem);
 
-      orig_to_rtx = to_rtx = expand_expr (tem, NULL_RTX, VOIDmode,
-                                         EXPAND_WRITE);
+      orig_to_rtx = to_rtx = expand_expr (tem, NULL_RTX, VOIDmode, 0);
+
       if (offset != 0)
        {
          rtx offset_rtx = expand_expr (offset, NULL_RTX, VOIDmode, 0);
@@ -5794,8 +5795,12 @@ highest_pow2_factor (exp)
       /* If the integer is expressable in a HOST_WIDE_INT, we can find the
         lowest bit that's a one.  If the result is zero, pessimize by
         returning 1.  This is overly-conservative, but such things should not
-        happen in the offset expressions that we are called with.  */
-      if (host_integerp (exp, 0))
+        happen in the offset expressions that we are called with.  If
+        the constant overlows, we some erroneous program, so return
+        BIGGEST_ALIGNMENT to avoid any later ICE.  */
+      if (TREE_CONSTANT_OVERFLOW (exp))
+       return BIGGEST_ALIGNMENT;
+      else if (host_integerp (exp, 0))
        {
          c0 = tree_low_cst (exp, 0);
          c0 = c0 < 0 ? - c0 : c0;