From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26476 invoked by alias); 3 Jul 2010 11:17:47 -0000 Received: (qmail 26437 invoked by uid 48); 3 Jul 2010 11:17:35 -0000 Date: Sat, 03 Jul 2010 11:17:00 -0000 Message-ID: <20100703111735.26436.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/44790] Bootstrap fails after MEM-REF merge In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-07/txt/msg00300.txt.bz2 ------- Comment #2 from rguenth at gcc dot gnu dot org 2010-07-03 11:17 ------- The code in question is likely expr.c:8830 ff: address_mode = targetm.addr_space.address_mode (as); op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, address_mode, EXPAND_NORMAL); if (!integer_zerop (TREE_OPERAND (exp, 1))) { rtx off; 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); I see that POINTER_PLUS_EXPR would end up doing ;; ap_2 = ap_1 + 8; (insn 10 9 11 t.i:8 (set (reg:SI 345) (plus:SI (subreg/s/v:SI (reg/v/f:DI 339 [ ap+-4 ]) 4) (const_int 8 [0x8]))) -1 (nil)) (insn 11 10 0 t.i:8 (set (reg/v/f:DI 340 [ ap+-4 ]) (unspec:DI [ (reg:SI 345) ] 24)) -1 (nil)) thus appearantly the pointer mode is DI but offsets are 32bit(?!) OTOH doing Index: expr.c =================================================================== --- expr.c (revision 161771) +++ expr.c (working copy) @@ -8817,14 +8817,12 @@ expand_expr_real_1 (tree exp, rtx target } } address_mode = targetm.addr_space.address_mode (as); - op0 = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, address_mode, - EXPAND_NORMAL); + base = TREE_OPERAND (exp, 0); if (!integer_zerop (TREE_OPERAND (exp, 1))) - { - rtx off; - off = immed_double_int_const (mem_ref_offset (exp), address_mode); - op0 = simplify_gen_binary (PLUS, address_mode, op0, off); - } + 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); op0 = memory_address_addr_space (mode, op0, as); temp = gen_rtx_MEM (mode, op0); set_mem_attributes (temp, exp, 0); generates (insn 13 12 14 t.i:8 (set (reg:DI 346) (reg/v/f:DI 339 [ ap+-4 ])) -1 (nil)) (insn 14 13 15 t.i:8 (set (reg/f:DI 347) (plus:DI (reg/v/f:DI 339 [ ap+-4 ]) (const_int 4 [0x4]))) -1 (nil)) (insn 15 14 16 t.i:9 (set (reg:SI 348) (mem:SI (reg/f:DI 347) [0 MEM[(long int *)ap_1 + 4B]+0 S4 A32])) -1 (nil)) which doesn't use an UNSPEC either. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44790