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.133.124]) by sourceware.org (Postfix) with ESMTP id C635B385740A for ; Fri, 9 Jul 2021 21:40:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C635B385740A Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-338-os1QtpBgPnCVygGkuR9MUQ-1; Fri, 09 Jul 2021 17:40:55 -0400 X-MC-Unique: os1QtpBgPnCVygGkuR9MUQ-1 Received: by mail-qt1-f199.google.com with SMTP id v17-20020a05622a1451b02902533c8b7139so2930726qtx.3 for ; Fri, 09 Jul 2021 14:40:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+ABxNgugD/XqpoIvdh/Ze5WM7/UWRD/OKkwrpoGyTIA=; b=KqEkgQcOPmx5xSXUi44IuPeY/xRqDi3NSOmczWnwFKsJpNUoogfNst9wkS0F/m+tF1 gqY/4gGJA0V5MxAuE2AKuHUhI2MvFdHvieaDMkYXeSWQqvqXwwE0jJRlbZLJmnRTfTfK DYDbZGeSzrESfgiWNXxeqDYkG0UlYhtnPgbdYhX6r8YJtfMiwZ/WJoKclQYdKj4aboO8 ZqDKnrmKtULiLcTWxSQAVQIorMS7jxGT1AY9q3JIMzGDtHiQPaErk8qjJYKrXmaaYSyL 3lta22pPB3+4R43lVW49Ym9jJgqIyDowZb6bXTfud5YxrfoTlgI/c7BOD+lT1e/EmbPd 4hjQ== X-Gm-Message-State: AOAM530F3Z/0IdzndDhChGHi57S7AikZQkVn0ExXWxbwdh+ao0Iu+eTI 0brTFit0EADixO6Zaq3mrpdQYfEpg0FjyXiAfdoswtBnMXeat8DtUUYkPsbsyO6vShXfYj4dzjo S1+Pp28mCvc/4j5ve9DDyZb2TWm8VeN7fPpsP2Q/kXCZE2h3adYeEOrFKpDg86Se02Q== X-Received: by 2002:ac8:7207:: with SMTP id a7mr35976944qtp.32.1625866854156; Fri, 09 Jul 2021 14:40:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8slMh+ijPV4jj00fc51XlnSkRFKFbFGWcZEQ530AQ9gANuuVaElh11eE+db9c4iLkD9mcWA== X-Received: by 2002:ac8:7207:: with SMTP id a7mr35976930qtp.32.1625866853820; Fri, 09 Jul 2021 14:40:53 -0700 (PDT) Received: from [192.168.1.148] (130-44-159-43.s11817.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id 3sm2568598qtz.5.2021.07.09.14.40.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Jul 2021 14:40:53 -0700 (PDT) Subject: Re: [PATCH] coroutines: Adjust outlined function names [PR95520]. To: Iain Sandoe , GCC Patches References: From: Jason Merrill Message-ID: Date: Fri, 9 Jul 2021 17:40:52 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-13.3 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_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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: Fri, 09 Jul 2021 21:40:58 -0000 On 7/9/21 2:18 PM, Iain Sandoe wrote: > Hi, > > The mechanism used to date for uniquing the coroutine helper > functions (actor, destroy) was over-complicating things and > leading to the noted PR and also difficulties in setting > breakpoints on these functions (so this will help PR99215 as > well). The revised mangling matches the form used by clang. > > OK for master & backports? > thanks > Iain > > Signed-off-by: Iain Sandoe > > PR c++/95520 - [coroutines] __builtin_FUNCTION() returns mangled .actor instead of original function name > > PR c++/95520 > > gcc/cp/ChangeLog: > > * coroutines.cc (act_des_fn): Adjust coroutine > helper function name mangling. > > gcc/testsuite/ChangeLog: > > * g++.dg/coroutines/pr95520.C: New test. > --- > gcc/cp/coroutines.cc | 14 +++++++++-- > gcc/testsuite/g++.dg/coroutines/pr95520.C | 29 +++++++++++++++++++++++ > 2 files changed, 41 insertions(+), 2 deletions(-) > create mode 100644 gcc/testsuite/g++.dg/coroutines/pr95520.C > > diff --git a/gcc/cp/coroutines.cc b/gcc/cp/coroutines.cc > index 54ffdc8d062..1a3ab58e044 100644 > --- a/gcc/cp/coroutines.cc > +++ b/gcc/cp/coroutines.cc > @@ -3985,9 +3985,19 @@ register_local_var_uses (tree *stmt, int *do_subtree, void *d) > static tree > act_des_fn (tree orig, tree fn_type, tree coro_frame_ptr, const char* name) > { > - tree fn_name = get_fn_local_identifier (orig, name); > + tree fn_name; > location_t loc = DECL_SOURCE_LOCATION (orig); > - tree fn = build_lang_decl (FUNCTION_DECL, fn_name, fn_type); > + tree fn = build_lang_decl (FUNCTION_DECL, DECL_NAME (orig), fn_type); > + if (tree da_name = DECL_ASSEMBLER_NAME (orig)) > + { > + char *buf = xasprintf ("%s.%s", IDENTIFIER_POINTER (da_name), name); > + fn_name = get_identifier (buf); > + free (buf); > + } > + else > + fn_name = get_fn_local_identifier (orig, name); How about handling this in write_encoding, along the lines of the devel/c++-contracts branch? Speaking of which, I wonder if you also want to do something similar to what I did there to put the ramp/actor/destroyer functions into into the same comdat group. Jason