From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15134 invoked by alias); 9 Mar 2013 14:58:27 -0000 Received: (qmail 14722 invoked by uid 48); 9 Mar 2013 14:57:54 -0000 From: "steven at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/39326] Segmentation fault with -O1, out of memory with -O2 Date: Sat, 09 Mar 2013 14:58: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: compile-time-hog, memory-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: steven at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: steven 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: 2013-03/txt/msg00744.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39326 --- Comment #43 from Steven Bosscher 2013-03-09 14:57:52 UTC --- The problem with combine is only "collateral damage" from what dse1 is doing to this function. It's loading stored values into registers and replacing re-loads with those registers, as in: @@ -747831,6 +780399,7 @@ 474783: r569578:SF=r569577:SF-r177936:SF REG_DEAD r569577:SF REG_DEAD r177936:SF + 605734: r662460:SF=r569578:SF 474784: [const(`t18571.26403'+0x5fe8)]=r569578:SF REG_DEAD r569578:SF 474786: r177942:SF=[const(`t12303.26335'+0x9008)] ... 487110: [const(`t24716.26406'+0x2ff0)]=r578824:SF REG_DEAD r578824:SF - 487113: r578827:SF=[const(`t18571.26403'+0x5fe8)] + 487113: r578827:SF=r662460:SF 487114: [const(`t24716.26406'+0x2ff4)]=r578827:SF REG_DEAD r578827:SF The distance between the store and load is large, and that is what is causing combine to blow up -- walking all the insns between 605734 and 487113 (about 500 of them, which appears to be typical). This also increases register pressure, causing the poor IRA/LRA/postreload numbers. Also not great: dse is loading the same stored value into multiple registers, e.g.: @@ -147272,6 +175190,8 @@ 110394: r288307:SF=r288306:SF-r37078:SF REG_DEAD r288306:SF REG_DEAD r37078:SF + 601084: r657810:SF=r288307:SF + 601085: r657811:SF=r288307:SF 110395: [r288302:DI]=r288307:SF REG_DEAD r288307:SF but I'm guessing (and verifying now) that this is cleaned up by fwprop2.