From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2842 invoked by alias); 17 Oct 2011 15:29:20 -0000 Received: (qmail 2825 invoked by uid 22791); 17 Oct 2011 15:29:19 -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; Mon, 17 Oct 2011 15:29:05 +0000 From: "matz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/50741] [4.7 Regression] remove_unused_locals causes seg fault Date: Mon, 17 Oct 2011 15:29: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: matz at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.7.0 X-Bugzilla-Changed-Fields: CC 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: 2011-10/txt/msg01634.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50741 Michael Matz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #5 from Michael Matz 2011-10-17 15:28:47 UTC --- And of course, it's the ctor cloning: DECL_CONTEXT of _rL_53 is , but current_function_decl is . So it's similar to PR50640, in that the initializers of statics declared in different functions aren't walked. That's reasonable assuming that such initializers are walked when the declaring function is handled (which is reasonable to expect, as otherwise the initializer couldn't have been known). But here the cloning and rewriting gets into our way.