]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/6212
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 May 2002 05:44:26 +0000 (05:44 +0000)
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 7 May 2002 05:44:26 +0000 (05:44 +0000)
        * expr.c (highest_pow2_factor_for_type): New.
        (expand_assignment): Use it.

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

gcc/ChangeLog
gcc/expr.c

index c13d5e7116d13da7c09658ce2e8bc1b49e858c3b..0c54cdeb82f8a12b53ec78f0bc2886a71723457d 100644 (file)
@@ -1,8 +1,14 @@
+2002-05-06  Richard Henderson  <rth@redhat.com>
+
+       PR c++/6212
+       * expr.c (highest_pow2_factor_for_type): New.
+       (expand_assignment): Use it.
+
 2002-05-06  Aldy Hernandez  <aldyh@redhat.com>
 
-        * config/rs6000/rs6000.md ("altivec_mtvscr"): Change to
-        unspec_volatile.
-        ("altivec_mfvscr"): Same.
+       * config/rs6000/rs6000.md ("altivec_mtvscr"): Change to
+       unspec_volatile.
+       ("altivec_mfvscr"): Same.
 
 2002-05-06  Janis Johnson  <janis187@us.ibm.com>
 
@@ -26,7 +32,7 @@
        PR opt/3995
        * fold-const.c (sign_bit_p): New function.
        (fold) [EQ_EXPR]: Use this to convert (A & C) == 0 into A >= 0 and
-        (A & C) != 0 into A < 0, when constant C is the sign bit of A's type.
+       (A & C) != 0 into A < 0, when constant C is the sign bit of A's type.
        Reapply fold when converting (A & C) == C into (A & C) != 0.
        (fold_binary_op_with_conditional_arg): Fix typo in comment.
 
@@ -85,7 +91,7 @@ doc:
 2002-05-06  Catherine Moore  <clm@redhat.com>
 
        * config/v850/v850.c (compute_register_save_size): Make sure
-        to count all of the registers that will be saved.
+       to count all of the registers that will be saved.
 
 Mon May  6 18:03:11 CEST 2002  Jan Hubicka  <jh@suse.cz>
 
index dc4c335628603aaf317b7c6c639b37d67c2dad14..84443e014e6e115afcaab3b54d36656d6b077128 100644 (file)
@@ -147,6 +147,7 @@ static rtx store_field              PARAMS ((rtx, HOST_WIDE_INT,
                                         int));
 static rtx var_rtx             PARAMS ((tree));
 static HOST_WIDE_INT highest_pow2_factor PARAMS ((tree));
+static HOST_WIDE_INT highest_pow2_factor_for_type PARAMS ((tree, tree));
 static int is_aligning_offset  PARAMS ((tree, tree));
 static rtx expand_increment    PARAMS ((tree, int, int));
 static void do_jump_by_parts_greater PARAMS ((tree, int, rtx, rtx));
@@ -3707,7 +3708,8 @@ expand_assignment (to, from, want_value, suggest_reg)
            }
 
          to_rtx = offset_address (to_rtx, offset_rtx,
-                                  highest_pow2_factor (offset));
+                                  highest_pow2_factor_for_type (TREE_TYPE (to),
+                                                                offset));
        }
 
       if (GET_CODE (to_rtx) == MEM)
@@ -5934,6 +5936,21 @@ highest_pow2_factor (exp)
 
   return 1;
 }
+
+/* Similar, except that it is known that the expression must be a multiple
+   of the alignment of TYPE.  */
+
+static HOST_WIDE_INT
+highest_pow2_factor_for_type (type, exp)
+     tree type;
+     tree exp;
+{
+  HOST_WIDE_INT type_align, factor;
+
+  factor = highest_pow2_factor (exp);
+  type_align = TYPE_ALIGN (type) / BITS_PER_UNIT;
+  return MAX (factor, type_align);
+}
 \f
 /* Return an object on the placeholder list that matches EXP, a
    PLACEHOLDER_EXPR.  An object "matches" if it is of the type of the