From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7840) id 59A0F3858D1E; Sat, 1 Oct 2022 00:36:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59A0F3858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664584589; bh=j3rmkEfibofL0NtwChsrlIhygeb7PcTxrN//Lv3cnAE=; h=From:To:Subject:Date:From; b=SiJthdiNaOCk7bXnNh61lD3Ol087b/dB+5ZrDEAe5QlkIdIy9yXY0g4z6P+NJEjcs vVsoIeYqPKGWUFIMEjIO8JOA68KA/GPjLFqqQ4Or9LBMjjBXTC59TCsDlQH8ZQqiLW S08101Xb+CvmDuViMcvLsnbgbVAx/P4j5dMechOY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eugene Rozenfeld To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3006] Emit discriminators for inlined call sites. X-Act-Checkin: gcc X-Git-Author: Eugene Rozenfeld X-Git-Refname: refs/heads/master X-Git-Oldrev: 3a221b73d04496318c5b7b69c1d78d6ff83a8bfb X-Git-Newrev: c3cb74aee204a41f7049617d453f2c20c2b1febe Message-Id: <20221001003629.59A0F3858D1E@sourceware.org> Date: Sat, 1 Oct 2022 00:36:29 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c3cb74aee204a41f7049617d453f2c20c2b1febe commit r13-3006-gc3cb74aee204a41f7049617d453f2c20c2b1febe Author: Eugene Rozenfeld Date: Thu Apr 21 16:17:52 2022 -0700 Emit discriminators for inlined call sites. This change is based on commit 9fa26998a63d4b22b637ed8702520819e408a694 by Dehao Chen in vendors/google/heads/gcc-4_8. Tested on x86_64-pc-linux-gnu. gcc/ChangeLog: * dwarf2out.cc (add_call_src_coords_attributes): Emit discriminators for inlined call sites. Diff: --- gcc/dwarf2out.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 2df75904022..e81044b8c48 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -24783,7 +24783,8 @@ add_call_src_coords_attributes (tree stmt, dw_die_ref die) if (RESERVED_LOCATION_P (BLOCK_SOURCE_LOCATION (stmt))) return; - expanded_location s = expand_location (BLOCK_SOURCE_LOCATION (stmt)); + location_t locus = BLOCK_SOURCE_LOCATION (stmt); + expanded_location s = expand_location (locus); if (dwarf_version >= 3 || !dwarf_strict) { @@ -24791,6 +24792,9 @@ add_call_src_coords_attributes (tree stmt, dw_die_ref die) add_AT_unsigned (die, DW_AT_call_line, s.line); if (debug_column_info && s.column) add_AT_unsigned (die, DW_AT_call_column, s.column); + unsigned discr = get_discriminator_from_loc (locus); + if (discr != 0) + add_AT_unsigned (die, DW_AT_GNU_discriminator, discr); } }