From patchwork Fri Sep 28 09:03:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 976098 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-486610-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="BEfG1h7X"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42M5Lf2TVqz9s3x for ; Fri, 28 Sep 2018 19:03:21 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=CUUbtpWC2ki1RQcWlX4JnKMy+pb2Ta18uH+DN67MVCTVs8immE 8sd8n9/74FWbSYt99ga5Y6W5seTGoeH+EI2gFH+MTaBn4t+l7JfmI9VB1dSDXjZv bxxgu7bt8uuiGh02gUBotWLaBb8hxOHiJjwg1+KEOYfXGZewVFIy2S5Ag= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=h/PImCUpBSGSRS8u24IHp3wJnJw=; b=BEfG1h7XwIG/JA/QfjYe 1NTM/2lTKQDtl74PrH7Fndyzz8zLv2UT65x+kNh+TfVW0jgj69vLyvLtpFhiBJJ1 zV12PsLxagRtst0GFKerA3PzIzYXHCZbwaa7qN3b9r8y4Ggiag6ODD88YeqmT3W9 YEU2efHTAWDfrgArX8KCvxw= Received: (qmail 128786 invoked by alias); 28 Sep 2018 09:03:14 -0000 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 Received: (qmail 128775 invoked by uid 89); 28 Sep 2018 09:03:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=ham version=3.3.2 spammy=callee, basic_block X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Sep 2018 09:03:12 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BCA85B078; Fri, 28 Sep 2018 09:03:09 +0000 (UTC) Date: Fri, 28 Sep 2018 11:03:06 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: aoliva@redhat.com Subject: [PATCH][2/n] Make _INLINE_ENTRY markers have the location we finally need Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 The following patch makes the inliner assign the decl location of the function we inline to the inline-entry marker which is what we later need when processing line info. This avoids the need to keep the actual FUNCTION_DECL live until that point. It avoids streaming it to LTO and allows us to simply stick a reference to an early created DIE in BLOCK_ABSTRACT_ORIGIN, which is why it is in this series. Alex - any particular reason for not doing this? Bootstrap & regtest running on x86_64-unknown-linux-gnu (but I do not expect testsuite coverage for this...) Richard. 2018-09-28 Richard Biener * tree-inline.c (expand_call_inline): Use the location of the callee declaration for the inline-entry marker. * final.c (notice_source_line): Remove special-casing of NOTE_INSN_INLINE_ENTRY. Index: gcc/tree-inline.c =================================================================== --- gcc/tree-inline.c (revision 264686) +++ gcc/tree-inline.c (working copy) @@ -4592,7 +4592,8 @@ expand_call_inline (basic_block bb, gimp { gimple_stmt_iterator si = gsi_last_bb (bb); gsi_insert_after (&si, gimple_build_debug_inline_entry - (id->block, input_location), GSI_NEW_STMT); + (id->block, DECL_SOURCE_LOCATION (id->src_fn)), + GSI_NEW_STMT); } if (DECL_INITIAL (fn)) Index: gcc/final.c =================================================================== --- gcc/final.c (revision 264686) +++ gcc/final.c (working copy) @@ -3224,17 +3224,6 @@ notice_source_line (rtx_insn *insn, bool if (NOTE_MARKER_P (insn)) { location_t loc = NOTE_MARKER_LOCATION (insn); - /* The inline entry markers (gimple, insn, note) carry the - location of the call, because that's what we want to carry - during compilation, but the location we want to output in - debug information for the inline entry point is the location - of the function itself. */ - if (NOTE_KIND (insn) == NOTE_INSN_INLINE_ENTRY) - { - tree block = LOCATION_BLOCK (loc); - tree fn = block_ultimate_origin (block); - loc = DECL_SOURCE_LOCATION (fn); - } expanded_location xloc = expand_location (loc); if (xloc.line == 0) {