From patchwork Tue Oct 9 14:26:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 190327 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6E77A2C077F for ; Wed, 10 Oct 2012 01:30:17 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350397818; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Date: From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=7QugS+S /P3jzKII0vexHoDrnm6g=; b=BEE9+D/E1r4nZ7coMdZQfBPqeaocP9znDbZeykl suzF7S3oo841unYjLSwFnjTTNlUtG9bHJVYGHeY7ejRqo4uD0B26eUrGPjPCyw4R wX8M2pcGIZXMYgkt4sA8Mh2DTLjo2mIrV0mW2Up1D2x7ZlZu8cvnVWNkXmTCH3AD tcNY= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Date:From:To:Cc:Subject:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=tHldHrfUabWmYFzvGzA/trQKCz21OQusWI3aqsL4V5UHxXGcAbVNP7SmuCqwCt bNBaIsvsexfoFqgNvZRGaMQssOrFjMwrBQ/8pR8pYdUd1gi1LliaMRhzh/b/U8KO 0UKHjNO0WkAFnbBK2wg4ml9BG0VJEXRSUaOShaMsIedS0=; Received: (qmail 31250 invoked by alias); 9 Oct 2012 14:30:02 -0000 Received: (qmail 31192 invoked by uid 22791); 9 Oct 2012 14:29:59 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Oct 2012 14:29:54 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 66ED6A39D0; Tue, 9 Oct 2012 16:29:53 +0200 (CEST) Date: Tue, 9 Oct 2012 16:26:32 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek Subject: [PATCH] Fix PR54837 Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This should fix PR54837, LTO is not yet prepared for debug source stmts. The following moves checking code that triggers to a place where it hopefully does not trigger. LTO bootstrap is broken in other ways though :( Will commit after non-LTO bootstrap finished to make progress. Richard. 2012-10-09 Richard Guenther PR middle-end/54837 * cfgexpand.c (expand_debug_source_expr): Move checking code conditional on a found decl_debug_args vector. Index: gcc/cfgexpand.c =================================================================== --- gcc/cfgexpand.c (revision 192253) +++ gcc/cfgexpand.c (working copy) @@ -3521,25 +3521,23 @@ expand_debug_source_expr (tree exp) && !DECL_INCOMING_RTL (exp) && DECL_ABSTRACT_ORIGIN (current_function_decl)) { - tree aexp = exp; - if (DECL_ABSTRACT_ORIGIN (exp)) - aexp = DECL_ABSTRACT_ORIGIN (exp); + tree aexp = DECL_ORIGIN (exp); if (DECL_CONTEXT (aexp) == DECL_ABSTRACT_ORIGIN (current_function_decl)) { VEC(tree, gc) **debug_args; unsigned int ix; tree ddecl; -#ifdef ENABLE_CHECKING - tree parm; - for (parm = DECL_ARGUMENTS (current_function_decl); - parm; parm = DECL_CHAIN (parm)) - gcc_assert (parm != exp - && DECL_ABSTRACT_ORIGIN (parm) != aexp); -#endif debug_args = decl_debug_args_lookup (current_function_decl); if (debug_args != NULL) { +#ifdef ENABLE_CHECKING + tree parm; + for (parm = DECL_ARGUMENTS (current_function_decl); + parm; parm = DECL_CHAIN (parm)) + gcc_assert (parm != exp + && DECL_ABSTRACT_ORIGIN (parm) != aexp); +#endif for (ix = 0; VEC_iterate (tree, *debug_args, ix, ddecl); ix += 2) if (ddecl == aexp)