]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/44790 (Bootstrap fails after MEM-REF merge)
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 28 Jul 2010 07:44:34 +0000 (07:44 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Wed, 28 Jul 2010 07:44:34 +0000 (07:44 +0000)
PR middle-end/44790
PR middle-end/44993
* expr.c (expand_expr_real_1) <MEM_REF>: Revert latest change.  Make
sure the base has address_mode before adding the offset.

From-SVN: r162618

gcc/ChangeLog
gcc/expr.c

index 1d0b5356c662b0f3a7f1b9ea8a7bafd1d4ccf435..2ec44035826249c13a4574adc693cda575acb4cc 100644 (file)
@@ -1,4 +1,12 @@
+2010-07-28  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR middle-end/44790
+       PR middle-end/44993
+       * expr.c (expand_expr_real_1) <MEM_REF>: Revert latest change.  Make
+       sure the base has address_mode before adding the offset.
+
 2010-07-27  Xinliang David Li <davidxl@google.com>
+
        * tree-flow.h (create_mem_ref): Add one new parameter.
        * tree-ssa-address.c (create_mem_ref): New parameter.
        (addr_to_parts): Ditto.
index 57f9eff859b2e86772031e46008c5da3c594a43e..a27dfd8e4ab73defa247c356165285f28d5a856d 100644 (file)
@@ -8730,11 +8730,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
          base = build2 (BIT_AND_EXPR, TREE_TYPE (base),
                         gimple_assign_rhs1 (def_stmt),
                         gimple_assign_rhs2 (def_stmt));
+       op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_NORMAL);
+       op0 = convert_memory_address_addr_space (address_mode, op0, as);
        if (!integer_zerop (TREE_OPERAND (exp, 1)))
-         base = build2 (POINTER_PLUS_EXPR, TREE_TYPE (base),
-                        base, double_int_to_tree (sizetype,
-                                                  mem_ref_offset (exp)));
-       op0 = expand_expr (base, NULL_RTX, address_mode, EXPAND_SUM);
+         {
+           rtx off
+             = immed_double_int_const (mem_ref_offset (exp), address_mode);
+           op0 = simplify_gen_binary (PLUS, address_mode, op0, off);
+         }
        op0 = memory_address_addr_space (mode, op0, as);
        temp = gen_rtx_MEM (mode, op0);
        set_mem_attributes (temp, exp, 0);