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 519E43872207 for ; Thu, 15 Dec 2022 21:48:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 519E43872207 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=1671140919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=plYUAB87OvELv3GPyj949lWKXDK8iE+UB1LMlchihm8=; b=Z3dSrAgDq4DzQZw4NlJg7axdtv1pWoPx29RDSKtNTBwdBnwrWigwpkBb1gGKDNy0i1DYz3 k88s23F7EqPaNzYr+rCpC9ZXEr9MJUP+qUvJ/3eaeI5yK/nCUEQt7dYgvOUMO1Nzx1QsfR HcqtI8QXp/YU4DJdszlpgDTGh8GdGnk= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-621-2gqYwz5kM66P2TjjAd8wUw-1; Thu, 15 Dec 2022 16:48:38 -0500 X-MC-Unique: 2gqYwz5kM66P2TjjAd8wUw-1 Received: by mail-qk1-f198.google.com with SMTP id br6-20020a05620a460600b007021e1a5c48so287148qkb.6 for ; Thu, 15 Dec 2022 13:48:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=plYUAB87OvELv3GPyj949lWKXDK8iE+UB1LMlchihm8=; b=4lGLSe/VEqgZ4q1H6Dr9ZeslWRCgh15l1y3BPJiLjR0LCVlaG1ThScROM3ltDuvkcn xFroKJKoqPoS5MhNeXd26MpJxTgR0eV8rFksXd6dolTPF/+CsC8FEVBRiCMD4wTNCM7J gVB/SG/6S6HBszldoYAds0sYOokLJ9bpkngjYsMVPNdEOs31p46OrcWXsiflCXjlzV9S fDE1y9qR9+bkK8slnO2GaUIRrjbO1W5wVqVd9rhutwk8dfVBNRFonSxaQ7X/5Xg9F34/ i1P3Xo2Z+9J5qFP3/TRAQHdLifwKA3xI1yWMYQVmiCnyh4vxwvFRL4Ku7i7gAK1kxAnC o5Eg== X-Gm-Message-State: ANoB5pnh/RwEUIvG7sassVxCbqYwkNEgZsi89PuSDWkMYcBlPQBq39xU IgNageeqoP4/WZW7xUkad0WUEe02Xe/bq2JCC2jtgqHB7tM3mBq/xKP8RsdZp6wO3VYoktNIDuI s5HRRVV6lRNyTYbGQCw== X-Received: by 2002:ac8:5c83:0:b0:3a6:c4eb:2e52 with SMTP id r3-20020ac85c83000000b003a6c4eb2e52mr53585082qta.43.1671140917937; Thu, 15 Dec 2022 13:48:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf77dhJA9lM2LgubjXSMlUhlBInvgWZyEPRncs4/3OXpqkENx1oHos8jaUPcCi6zL516AvYldg== X-Received: by 2002:ac8:5c83:0:b0:3a6:c4eb:2e52 with SMTP id r3-20020ac85c83000000b003a6c4eb2e52mr53585044qta.43.1671140917539; Thu, 15 Dec 2022 13:48:37 -0800 (PST) Received: from [192.168.1.108] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id de36-20020a05620a372400b006cf19068261sm30571qkb.116.2022.12.15.13.48.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Dec 2022 13:48:37 -0800 (PST) Message-ID: <1dd4376e-84c1-c81c-415e-76c41d1e2475@redhat.com> Date: Thu, 15 Dec 2022 16:48:36 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] contracts: Stop relying on mangling for naming .pre/.post clones To: =?UTF-8?Q?Arsen_Arsenovi=c4=87?= Cc: gcc-patches@gcc.gnu.org References: <20221210131356.3385654-1-arsen@aarsen.me> <5cc46cd6-5f08-e73a-0db2-ea165a6e7734@redhat.com> <86bko4ttho.fsf@aarsen.me> From: Jason Merrill In-Reply-To: <86bko4ttho.fsf@aarsen.me> 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: 8bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 12/15/22 13:00, Arsen Arsenović wrote: > Hi Jason, > > Jason Merrill writes: > >> On 12/10/22 08:13, Arsen Arsenović wrote: >>> If the mangler is relied on, functions with extern "C" on them emit multiple >>> definitions of the same name. >> >> But doing it here interferes with lazy mangling. How about appending the >> suffix into write_mangled_name instead of write_encoding? The demangler >> already expects "clone" suffixes at the end of the mangled name. > > Ah, sorry. I'm not well versed in the mangler code, so I didn't realize > (frankly, I was initially surprised when I saw that DECL_ASSEMBLER_NAME > was set that early, but went with it). That makes sense. > > How about this? Tested on x86_64-pc-linux-gnu via check-g++. > > > > I did run c++filt (afaik, it uses the libiberty demangler) on this > revision, and I got: > > .type f(int) [clone .pre], @function > f(int) [clone .pre]: > > out of ``void f(int x) [[ pre: x > 10 ]] {}'', which seems to match your > description. > > If I understand this right, write_xxx corresponds to xxx in the Itanium > ABI mangling BNF, in which case, I believe I have the correct spot here. > In that case, a similar change should happen for coroutines; I think > Iain was working on that. > * mangle.cc (write_encoding): Move contract pre/post function mangling It's best to wrap the ChangeLog entry at column 75 so that the extra indentation added by git log doesn't push past column 80. Applied with that change. Jason