From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7142 invoked by alias); 18 Dec 2012 11:30:55 -0000 Received: (qmail 6758 invoked by uid 48); 18 Dec 2012 11:30:09 -0000 From: "krebbel at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/55718] [4.8 Regression] ICE in gen_reg_rtx, at emit-rtl.c:866 Date: Tue, 18 Dec 2012 11:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: ra X-Bugzilla-Severity: normal X-Bugzilla-Who: krebbel at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: krebbel at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.8.0 X-Bugzilla-Changed-Fields: Status Last reconfirmed AssignedTo Ever Confirmed 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-12/txt/msg01721.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55718 Andreas Krebbel changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2012-12-18 AssignedTo|unassigned at gcc dot |krebbel at gcc dot gnu.org |gnu.org | Ever Confirmed|0 |1 --- Comment #3 from Andreas Krebbel 2012-12-18 11:30:06 UTC --- Created attachment 28993 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28993 Experimental fix Starting with http://gcc.gnu.org/ml/gcc-patches/2012-09/msg00088.html UNSPEC GOTENTs are accepted as legitimate address what leads to this error. For the strlen implementation we subtract the result from the source pointer. In the testcase the subtraction is done in a mode smaller than pointer size (SImode). The source pointer is the address of a global symbol in the GOT. Resolving the subreg on the address reload generates: (const:DI (plus:DI (unspec:DI [ (symbol_ref:DI ("temp") [flags 0x440] ) ] UNSPEC_GOTENT) (const_int 4 [0x4]))) Instead of just letting it pass legitmize_pic_address tries to generate code for the add what needs an additional register. The attached patch fixes this.