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 ESMTPS id 808AE3858C66 for ; Tue, 21 May 2024 21:36:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 808AE3858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 808AE3858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716327404; cv=none; b=YmTJWDxy5UBGl6gSk0w4xscbfdCRRCYbNqeHfqOpa7UloOdlpBolOwgIDKHmgXffc8Y9GlViPa738OJxQbLZwvXqaco7M0mlXATcTLFL27LNZJ4xzGJ+9bKUJO0SI+7ZUFaTO2gX/SKmPkr3i/UinHS+Va0JorCTqKB4MG6tWc4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716327404; c=relaxed/simple; bh=mIy0yzP/hCG7Jw/5H+TKLNEiOMDnZe1IMlVId5C4WOs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=sdJtreiSR8fhxaReZrWMeiWQPRhcD/4krkPMzqYL7Us8xuq/a9qVGGon/NNHHF5FAmEWrnI9tO9l/Cge0guxObJctfG0AEORuiW79CoH+Nr7s9N3xCiiuYllTbJLP5Jm7AEymhzdj/b9szT1cdVCyb5qvM2KQXZEbm187T85i9k= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716327403; 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=pg1De/LGOYi68cHbeBxdWlZtLt3IwzzrZ8NB6uZMwKA=; b=PX1dDwTBLY8GjXXhu1sI/Pp0EZ5rbF5NwOo3Dp+QavCp6KVz15f+pUNsOc7E9NfRJR5sA8 7eV4VzY9QGa14i2UxqLi22DYBQKN+rZHs31d4V/bVwZOZ8xM5o3tWQTTF3abMY804ZZ6a/ x2Qibjy9rzH8QzFeiER4FIzKKJVb2wA= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-602-7ev0l94YNPKYXcFdXvXINQ-1; Tue, 21 May 2024 17:36:41 -0400 X-MC-Unique: 7ev0l94YNPKYXcFdXvXINQ-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-6ab780e4a70so10311386d6.0 for ; Tue, 21 May 2024 14:36:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716327397; x=1716932197; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pg1De/LGOYi68cHbeBxdWlZtLt3IwzzrZ8NB6uZMwKA=; b=OSpC1OrRJ8j1h59F5sQZDlVZWBO6xLjypGtHwWTlUx2Wdb32Aa2Tcthryo8RbvlOTB NmUzCQslwUjk3eWXNWE6Sl5tuEYT/imIsZLCEzjIXtzAB4t0LXsWM4sLWz7CIYEWE5du iXK+7CaIMtKkheZwDfRcnmgQ3XBPMSj05WOszxgtr8ZvJ/FIwMPMV26LCHUILSxgoFaq AeNGuNxsBC3BPkmprXKwazepPe0nDRk/pairIHCELkU1rUkj1gv0AsK+4kaNDiYJ5i9B FRxkrHoGd5NJOUrQjvImQgx+Yv/5ksV6fcja7Wocvwgi7edJLPEfoV/0j9bngdlORyId rVZw== X-Gm-Message-State: AOJu0YyD4sCLIEzamy7h1n7o2B9dzSDS2Akv5L0houadNGpJEeeJYgsB /daQ8BIdAIhkKS5N9y9Bdgto78U/XlTm+hXIFvd/KbiaWpJUa/5DrU/6ArWGQPu+bleqLoXjbVb HgMr9I/kJwhJncHMZiJ0DBzssSVgrE97eYVPQfllmyFgdsJ3++3/m7V6PG5aEh9A= X-Received: by 2002:a05:6214:3110:b0:6a0:b3ff:1e79 with SMTP id 6a1803df08f44-6ab7f34f207mr1142536d6.22.1716327396740; Tue, 21 May 2024 14:36:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHgWlunMp96oKcU6IhnQz15h+GvDpRvAx0nfQfJqtomiRfPVapqV34dDIZI4Ja1qURk5+dTcg== X-Received: by 2002:a05:6214:3110:b0:6a0:b3ff:1e79 with SMTP id 6a1803df08f44-6ab7f34f207mr1142406d6.22.1716327396305; Tue, 21 May 2024 14:36:36 -0700 (PDT) Received: from [192.168.1.130] (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 6a1803df08f44-6a15f194d16sm125893216d6.66.2024.05.21.14.36.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 May 2024 14:36:35 -0700 (PDT) Message-ID: Date: Tue, 21 May 2024 17:36:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] c++: canonicity of fn types w/ complex eh specs [PR115159] To: Patrick Palka Cc: gcc-patches@gcc.gnu.org References: <20240521193629.4129787-1-ppalka@redhat.com> <42726cf3-3bf8-499a-b455-d0181f0b8d3b@redhat.com> <3356d9ff-9c60-a215-427c-9deaf6fb5024@idea> From: Jason Merrill In-Reply-To: <3356d9ff-9c60-a215-427c-9deaf6fb5024@idea> 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=-6.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 5/21/24 17:27, Patrick Palka wrote: > On Tue, 21 May 2024, Jason Merrill wrote: > >> On 5/21/24 15:36, Patrick Palka wrote: >>> Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look >>> OK for trunk? >>> >>> Alternatively, I considered fixing this by incrementing >>> comparing_specializations around the call to comp_except_specs in >>> cp_check_qualified_type, but generally for types whose identity >>> depends on whether comparing_specializations is set we need to >>> use structural equality anyway IIUC. >> >> Why not both? > > I figured the latter change isn't necessary/observable since > comparing_specializations would only make a difference for complex > exception specifications, and with this patch we won't even call > cp_check_qualified_type on a complex eh spec. My concern is that if we're building a function type multiple times with the same noexcept-spec, this patch would mean creating multiple equivalent function types instead of reusing one already created for the same function. >>> + bool complex_p = (cr && cr != noexcept_true_spec >>> + && !UNPARSED_NOEXCEPT_SPEC_P (cr)); >> >> Why treat unparsed specs differently from parsed ones? > > Unparsed specs are unique according to cp_tree_equal, so in turn > function types with unparsed specs are unique, so it should be safe to > treat such types as canonical. I'm not sure if this optimization > matters though; I'm happy to remove this case. The idea that this optimization could make a difference raised the concern above. Jason