]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/6212 (g++ testsuite EH regressions for irix6 -mabi=64)
authorRichard Henderson <rth@redhat.com>
Tue, 7 May 2002 05:43:11 +0000 (22:43 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 7 May 2002 05:43:11 +0000 (22:43 -0700)
        PR c++/6212
        * expr.c (highest_pow2_factor_for_type): New.
        (expand_assignment): Use it.

From-SVN: r53248

gcc/ChangeLog
gcc/expr.c

index 21880bb54b8c79b1311a2513742c1b4025af72cf..fab79af7ed249c38076d967cb079a97feacf5c74 100644 (file)
@@ -1,3 +1,9 @@
+2002-05-07  Richard Henderson  <rth@redhat.com>
+
+       PR c++/6212
+       * expr.c (highest_pow2_factor_for_type): New.
+       (expand_assignment): Use it.
+
 2002-05-07  Jakub Jelinek  <jakub@redhat.com>
 
        * configure.in: If as or ld segfaults, don't clutter with it stdout.
index ae35664a2445f90f18ec82684e1d89f084303a53..a6ec5466c8f58acde34b6fa5abbe7c67985331ed 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)
@@ -5909,6 +5911,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