From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 933DD385740F for ; Tue, 27 Jul 2021 12:37:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 933DD385740F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: FyJIBapIv/zHOS68SliZ8Fyip9uoGefBIda0kia3Adgu7JVfR/OJ37Btnae0y3DfF3GX8F0u8u vDYyJ18TYSCq7YzYorDkOKD+lNPe5sAzHJspmd6e8yqfhBuKOJ5gkCxTNUA19htiw/xzzoBZFG HL/5el80l40zLdsVqYQpJsVi2t85pY85+HMT9ojORkKEnIshD7D6fxCFbe16PkqO/NIl7ScrDA zDKpnKmunkHP6ViQ7IOh/kzWKER+jiKXcY6XoWzDyoKTM30L6Z8HsL824b9U+odE5CttY2Hc3u sUm5d47nRLlfFMLrprDQ7ZqV X-IronPort-AV: E=Sophos;i="5.84,273,1620720000"; d="scan'208";a="63958012" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 27 Jul 2021 04:37:09 -0800 IronPort-SDR: QL2S99a+WV99QaTA1H2Qx5gq4WDTUQekfEBYDpzPCA5Ogcvp6MWkB5B/+ePsHBEBD2VHH4xcDp AszsakY9f3AyzeMidpXmzgk2PGrtDYYy7fPL3bQUcZ1SGmG6xMkv9s5nTOY3w7PtrPmgsHbS/f ayZSPB+yO5TIzUfjwDKl+D1nyvJkWcZO2/bq4ksSgdsB1chb7io7MqVT3+UE2HgEaIgAFr0jqC PXgUKeA58qr2lAW1qc04ysUlTvbItropHF9SeuSMBOLTJg8ZNc3g27xb6+DSkQfW/uuN6dOkRG hhw= Subject: Re: [PATCH] [DWARF] Fix hierarchy of debug information for offload kernels. To: Richard Biener CC: Jakub Jelinek , Thomas Schwinge , Abid Qadeer , GCC Patches References: <8735sfamu7.fsf@dem-tschwing-1.ger.mentorg.com> <50d1657e-c5de-9cb9-1aaa-233f27dfe9b9@mentor.com> <210da16b-5992-7d7f-7223-4a4f08998d49@mentor.com> <6C66F8F4-71EC-431E-A0C5-737BBB9D84F3@gmail.com> <28f299d1-93d5-ff33-1a83-41f373d3d1f7@mentor.com> <20210722114815.GT2380545@tucnak> <33e9b2c3-7ab6-211b-253e-d2004af635c5@mentor.com> From: Hafiz Abid Qadeer Message-ID: <8ce48e20-adcf-3338-82de-83082575f07e@mentor.com> Date: Tue, 27 Jul 2021 13:37:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) To SVR-IES-MBX-03.mgc.mentorg.com (139.181.222.3) X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jul 2021 12:37:12 -0000 On 27/07/2021 09:39, Richard Biener wrote: > Yes, that's true - there could be a one-to-many relationship there. But then I > wonder in which case such lookup in the DIE tree would be the correct thing > to do. If I lookup a variable from the parent then the concrete > instance of that > should be found by unwinding unless it is a static variable in which case > the lookup can be done in any of the concrete instances. > > But then the original issue that the consumer skips the function if it doesn't > have a PC range and thus skips over childs looks like an invalid optimization. > > Btw, the situation you run into can be simulated by > > int main(int argc, char **argv) > { > void foo () > { > __builtin_puts ("bar"); > } > foo (); > return 0; > } > > and compiling with -g -flto -flto-partition=max which forces main and foo > into different LTRANS units and get's us > > <1><114>: Abbrev Number: 2 (DW_TAG_subprogram) > <115> DW_AT_abstract_origin: <0x155> > <2><119>: Abbrev Number: 3 (DW_TAG_subprogram) > <11a> DW_AT_abstract_origin: <0x179> > <11e> DW_AT_low_pc : 0x400515 > <126> DW_AT_high_pc : 0x19 > <12e> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) > <130> DW_AT_static_link : 4 byte block: 91 68 6 6 (DW_OP_fbreg: -2 > > gdb then fails to see 'foo' at all (cannot break on it) and the lookup of 'argc' > inside it fails (setting a breakpoint also fails without -flto-partition=max, > but I can print argc just fine). > > I suggest you file a bug with gdb and see how that resolves. I have filed https://sourceware.org/bugzilla/show_bug.cgi?id=28147 for this issue. Thanks, -- Hafiz Abid Qadeer Mentor, a Siemens Business