From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31776 invoked by alias); 19 Jan 2012 13:18:36 -0000 Received: (qmail 31765 invoked by uid 22791); 19 Jan 2012 13:18:36 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 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 13:18:23 +0000 From: "rguenth 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 13:38: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: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 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/msg02145.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51895 --- Comment #8 from Richard Guenther 2012-01-19 13:17:25 UTC --- For example (untested, and probably completely bogus): Index: expr.c =================================================================== --- expr.c (revision 183296) +++ expr.c (working copy) @@ -1517,7 +1517,9 @@ move_block_to_reg (int regno, rtx x, int for (i = 0; i < nregs; i++) emit_move_insn (gen_rtx_REG (word_mode, regno + i), - operand_subword_force (x, i, mode)); + operand_subword_force (x, i, + CONSTANT_P (x) + ? mode : GET_MODE (x))); } /* Copy all or part of a BLKmode value X out of registers starting at REGNO. As written elsewhere operand_subword* should be deprecated ... so maybe we can use sth else in move_block_to_reg? The same effect could be achieved by changing operand_subword to adhere to its documentation and ignore mode if op is !CONST_INT_P ... thus Index: emit-rtl.c =================================================================== --- emit-rtl.c (revision 183296) +++ emit-rtl.c (working copy) @@ -1367,7 +1367,7 @@ paradoxical_subreg_p (const_rtx x) rtx operand_subword (rtx op, unsigned int offset, int validate_address, enum machine_mode mode) { - if (mode == VOIDmode) + if (!CONST_INT_P (op)) mode = GET_MODE (op); gcc_assert (mode != VOIDmode); Both fix the testcase.