From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15152 invoked by alias); 19 Jan 2012 02:43:04 -0000 Received: (qmail 15008 invoked by uid 22791); 19 Jan 2012 02:43:02 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_LV,TW_XF X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 19 Jan 2012 02:42:48 +0000 From: "bergner at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/51895] [4.7 Regression] ICE in simplify_subreg Date: Thu, 19 Jan 2012 04:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: bergner at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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: 2012-01/txt/msg02048.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51895 --- Comment #1 from Peter Bergner 2012-01-19 02:42:44 UTC --- We ICE when we try and do a BLK move from a reg:TI. In GCC 4.6, we don't see this, since the args[i].tree_value is different: (gdb-gcc4.6) ptree args[i].tree_value unit size align 64 symtab 0 alias set 43 canonical type 0xfffafd6f960 fields used private unsigned nonlocal decl_3 DI file t.ii line 30433 col 11 size unit size align 64 offset_align 128 offset bit offset context chain > context full-name "class llvm::SDValue" needs-constructor X() X(constX&) this=(X&) n_parents=0 use_template=0 interface-unknown pointer_to_this reference_to_this chain > used TI file t.ii line 45352 col 9 size unit size align 64 context abstract_origin (reg/v:TI 306 [ Ptr1 ])> versus for gcc 4.7: (gdb-gc4.7) ptree args[i].tree_value unit size align 8 symtab 0 alias set -1 canonical type 0xfffb5e403f0 precision 8 min max pointer_to_this reference_to_this > BLK size unit size align 8 symtab 0 alias set 0 canonical type 0xfffb0cac198 domain DI size unit size align 64 symtab 0 alias set -1 canonical type 0xfffb0cac0f0 precision 64 min max > pointer_to_this > arg 0 sizes-gimplified public unsigned type_6 DI size unit size align 64 symtab 0 alias set 2 canonical type 0xfffa8d50b28 pointer_to_this > arg 0 used TI file t.ii line 45286 col 6 size unit size align 64 context abstract_origin (reg/v:TI 279 [ Ptr1 ])>> arg 1 constant 0>> That difference forces us down different paths starting at this load_register_parameters() test: else if (TYPE_MODE (TREE_TYPE (args[i].tree_value)) == BLKmode) For 4.6, the mode is a TImode and for 4.7, it's a BLKmode. The following patch seems to fix it: Index: gcc/emit-rtl.c =================================================================== --- gcc/emit-rtl.c (revision 183280) +++ gcc/emit-rtl.c (working copy) @@ -1401,6 +1401,9 @@ operand_subword (rtx op, unsigned int of return replace_equiv_address (new_rtx, XEXP (new_rtx, 0)); } + if (REG_P (op) && mode == BLKmode) + mode = GET_MODE (op); + /* Rest can be handled by simplify_subreg. */ return simplify_gen_subreg (word_mode, op, mode, (offset * UNITS_PER_WORD)); } I'm bootstraping/regtesting this patch now.