From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 64E5E3858D38 for ; Mon, 19 Jun 2023 17:18:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 64E5E3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687195116; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DzlRNk54E8Y+uVK2FH3i+U8xI+nlSCm8TNgL6Sli9lY=; b=f2z7beTRf45ScCKKYRo1bBZ432UwF7PFJ9V4b7mTzdoC7XtaCkiGKxoMPTH15588EcDwIq rHfJnOB7p9nSvKfpharDbN86exc8xHbEKDZeML2TT+OEOk4sTHJn2siJIviA/PtzC0qgt1 PToicH0Jiftatt+G19wNLMBx50oic38= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-523-cDpXr3_hMEWez6ncspWRew-1; Mon, 19 Jun 2023 13:18:34 -0400 X-MC-Unique: cDpXr3_hMEWez6ncspWRew-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-62ff432dea7so37648476d6.1 for ; Mon, 19 Jun 2023 10:18:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687195114; x=1689787114; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DzlRNk54E8Y+uVK2FH3i+U8xI+nlSCm8TNgL6Sli9lY=; b=BxpAErpAyi70w51AdY0XTTEg2o4jJPs2N+1xR9onFcBBIqnhO5cbGujcbKzOIo6IhG eTJIc4P+P3ZcVlA1JskSjF54A3JpxsMmKSx10UdNbaKw1wLodeDNjY+p81AMdT3evts8 ihOFRMJdO7FDI+SP7TitBlc/56rG5tbnMcOiOoQTgwACm0qDJuGhqUOlrlg6P+dhwWN6 rw8QVjP+Rll3T9h4+oBkid3UIcMnhVd6dU5piH9DKbXQMPk/Q61M6t/fSj/rCmwtKioo uY/aneAVKJoeyeBk3kfY+yCJSq1A3LF8xUhNRZjmHixZcE2GqCEn26KhC+amp1+uZcvW ceXA== X-Gm-Message-State: AC+VfDypSvlS1Td2Z8ehM9Ctgmmmkmsi9sCK5m7B/7VyOIPHwPGDYJ6o XIw54hCXb7jgAA1g4RMUTSHMuMjugQuMmYJECgJKB8ODpjVbipYiww0uDbLyXIiFXiGJ5gdI/fU c4zlj1h4fj7c2C2G3EQ== X-Received: by 2002:a05:6214:b68:b0:62d:d4a2:ef0e with SMTP id ey8-20020a0562140b6800b0062dd4a2ef0emr13949726qvb.4.1687195113978; Mon, 19 Jun 2023 10:18:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5LeYUsCyQW/7sMYTW0z1Ls2nqfY6LLDBnBF+sX05PrVQOgkhkhJ80Bjyb/i8iYtTfoSi9iSg== X-Received: by 2002:a05:6214:b68:b0:62d:d4a2:ef0e with SMTP id ey8-20020a0562140b6800b0062dd4a2ef0emr13949704qvb.4.1687195113598; Mon, 19 Jun 2023 10:18:33 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id d27-20020a05620a137b00b007623ad55347sm122189qkl.104.2023.06.19.10.18.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Jun 2023 10:18:32 -0700 (PDT) Message-ID: <1fbbf155-ce44-450c-d4af-126012dedfaa@redhat.com> Date: Mon, 19 Jun 2023 13:18:32 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] debug/110295 - mixed up early/late debug for member DIEs To: Richard Biener , gcc-patches@gcc.gnu.org References: <10678.123061906202700891@us-mta-531.us.mimecast.lan> From: Jason Merrill In-Reply-To: <10678.123061906202700891@us-mta-531.us.mimecast.lan> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 6/19/23 06:15, Richard Biener wrote: > When we process a scope typedef during early debug creation and > we have already created a DIE for the type when the decl is > TYPE_DECL_IS_STUB and this DIE is still in limbo we end up > just re-parenting that type DIE instead of properly creating > a DIE for the decl, eventually picking up the now completed > type and creating DIEs for the members. Instead this is currently > defered to the second time we come here, when we annotate the > DIEs with locations late where now the type DIE is no longer > in limbo and we fall through doing the job for the decl. > > The following makes sure we perform the necessary early tasks > for this by continuing with the decl DIE creation after setting > a parent for the limbo type DIE. > > [LTO] Bootstrapped on x86_64-unknown-linux-gnu. > > OK for trunk? > > Thanks, > Richard. > > PR debug/110295 > * dwarf2out.cc (process_scope_var): Continue processing > the decl after setting a parent in case the existing DIE > was in limbo. > > * g++.dg/debug/pr110295.C: New testcase. > --- > gcc/dwarf2out.cc | 3 ++- > gcc/testsuite/g++.dg/debug/pr110295.C | 19 +++++++++++++++++++ > 2 files changed, 21 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/g++.dg/debug/pr110295.C > > diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc > index d89ffa66847..e70c47cec8d 100644 > --- a/gcc/dwarf2out.cc > +++ b/gcc/dwarf2out.cc > @@ -26533,7 +26533,8 @@ process_scope_var (tree stmt, tree decl, tree origin, dw_die_ref context_die) > > if (die != NULL && die->die_parent == NULL) > add_child_die (context_die, die); I wonder about reorganizing the function a bit to unify this parent setting with the one a bit below, which already falls through to gen_decl_die: > if (decl && DECL_P (decl)) > { > die = lookup_decl_die (decl); > > /* Early created DIEs do not have a parent as the decls refer > to the function as DECL_CONTEXT rather than the BLOCK. */ > if (die && die->die_parent == NULL) > { > gcc_assert (in_lto_p); > add_child_die (context_die, die); > } > } OK either way. Jason