From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20477 invoked by alias); 30 Dec 2010 20:15:33 -0000 Received: (qmail 20467 invoked by uid 22791); 30 Dec 2010 20:15:33 -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, 30 Dec 2010 20:15:29 +0000 From: "aoliva at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/47106] -fcompare-debug failure (length) with -fpartial-inlining -flto -fconserve-stack X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: aoliva at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: aoliva 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: Thu, 30 Dec 2010 20:15: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: 2010-12/txt/msg02985.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47106 --- Comment #2 from Alexandre Oliva 2010-12-30 20:15:22 UTC --- Created attachment 22870 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=22870 Patch that fixes the bug, regstrapping When estimating the stack size of a function, we shouldn't set TREE_USED in the loop over local decls, for this makes us count every block var that is local when accounting block vars: since we preserve more block vars for debugging purposes, we end up counting them all in the latter pass, even if they weren't marked as TREE_USED before the loop over locals. Simply removing the set would be enough to fix the bug, but I figured we'd get more accurate results if we refrained from counting variables twice, so I added a bitmap. This fixes the bug, testing a bootstrap with these flags now.