From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5318 invoked by alias); 18 Jul 2011 09:09:52 -0000 Received: (qmail 5308 invoked by uid 22791); 18 Jul 2011 09:09:51 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_ZJ 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; Mon, 18 Jul 2011 09:09:04 +0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/47744] [x32] ICE: in reload_cse_simplify_operands, at postreload.c:403 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail dot com 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 Date: Mon, 18 Jul 2011 09:09:00 -0000 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: 2011-07/txt/msg01408.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47744 --- Comment #28 from Uros Bizjak 2011-07-18 09:08:39 UTC --- Here is my latest proposed patch: --cut here-- Index: i386.c =================================================================== --- i386.c (revision 176386) +++ i386.c (working copy) @@ -11149,8 +11149,13 @@ return 0; break; + case SUBREG: + /* Allow only subregs of DImode hard regs in PLUS chains. */ + if (!register_no_elim_operand (SUBREG_REG (op), DImode)) + return 0; + /* FALLTHRU */ + case REG: - case SUBREG: if (!base) base = op; else if (!index) --cut here-- The patch will also benefit x86_64 and x86_32. The patch allows only SUBREGs with DImode non-eliminable hard register. This way paradoxical subregs are avoided, and at the same time, the patch makes sure that PLUS RTX in wider mode won't enter the address RTX (via combine pass, register elimination in reload, etc).