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 DF1FE3858D35 for ; Tue, 14 May 2024 21:52:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF1FE3858D35 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 DF1FE3858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715723526; cv=none; b=ooEAgSgJi7i/h3FybKIIxCsutT+R2uR55WVn2DNxzFPwtxrI5paD1BTFKtT3stv18dqIz1wcIj1Ad5PXILy+sFOtG2E2V4+dW2El/Bo7xGBw1h1NEVDkZzXWp7gotuXk7he0FH0bxIwkIjXFTJh7jhjr4KQnqGrcxjYNPEDfdok= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715723526; c=relaxed/simple; bh=n7QveE5o6HC81yYcXWgWWn6QAhIgHr0OyjmttdGAFLA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Nt+szyjUhuNkY5RDgYLSuvA/26Vy3cC6TKJQEOx7LjLxuOYv0fFR4QB3aOVoIGpwVjoL7PJhp4V4mVstxI/SNstDo4FKdxa1mzaclT1Ha+3f4Xvq+OgXYNbBfRomsjuI0vD+Na8olWyrqyKOLBFo4sa23+Co6rnZbpVc71AsJfc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715723524; 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=AlmXbyAaUK/sOke6GwvSpTwGZikyVlC57V9X+OFUWqU=; b=TqmicKM/+kxf7W8cpfuGJ3q5BmAjwh+pSf8bQUiqw15k56sxREjj0r03GLk4ScjcZh6O6p kVwROkT6g2siLP0BYx15FDENf8HiXhJI4TEB8ZbjX/WvFHDLeA20BHIABewKy7JTVPikdT HSJOr4itxdNigxkbsbFxz4Tyour8iw0= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-537-bO2JjdreMk2JIWF4UD_lmQ-1; Tue, 14 May 2024 17:52:03 -0400 X-MC-Unique: bO2JjdreMk2JIWF4UD_lmQ-1 Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-792bc73b975so870352885a.2 for ; Tue, 14 May 2024 14:52:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715723522; x=1716328322; 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=AlmXbyAaUK/sOke6GwvSpTwGZikyVlC57V9X+OFUWqU=; b=G0F65V4c3vFIaqiKymWEyfkkifeKkYuoRf1+FTrMmhGtLa1Hx+K9PSg/ZlMVr2JBKL iwglnE3LMcluYvZZP2kgO0uq0vgDk7YwA7sqGlFDWTdGf4dsBDkKJyqxLJx+Br9Il24n y5RZeYh5bx8wukMZAcAHdLmW8f0Hus0gbYU6zpoxSk1YjDT9uBgFVCh6w2kHN0yBbU+T 7yH3VYYJssiVc7yNtFvTj+nOQWpwcksuc3ivMTBXxAzpn4k0Bf/gMiHiMDzmWj434YhU T7lutW7XK7viU+bdgzd77fuz8GRSG1/aozuPkbVaozAgpsQITGmlMAzDSVvLb24BR9j4 BkmA== X-Gm-Message-State: AOJu0YxRf7t2kyvxy2QyDRXf43nN5JanGUMhWJTdCtThK0cglaPAUDPt VHag5mPiIZsi+mLwHWVeYE3N/r+h54aCc3zUkaQAiGUmsCGyd7svsbV7qb5TOqwEkgkSFIE6YOs tG3xqRAfT1D7eHiniK6nrmygST2J5XzvxFNTRYdvveVYBatFHzKd4WVfxVya3uR4= X-Received: by 2002:a05:620a:565a:b0:792:9429:6b09 with SMTP id af79cd13be357-792c7600c85mr1571165485a.74.1715723522228; Tue, 14 May 2024 14:52:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDNMMNSvpO9Pd3tQqCleoAEGd8nEBcqfknl9gAFdQl/6wTp8ojFWuvdHu31IGo3qg8YlF5zQ== X-Received: by 2002:a05:620a:565a:b0:792:9429:6b09 with SMTP id af79cd13be357-792c7600c85mr1571163885a.74.1715723521793; Tue, 14 May 2024 14:52:01 -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 af79cd13be357-792bf2fc587sm607881485a.75.2024.05.14.14.52.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 May 2024 14:52:01 -0700 (PDT) Message-ID: <018be9ad-e6e8-47f8-85c3-e830599ada39@redhat.com> Date: Tue, 14 May 2024 17:52:00 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 2/5] C++: Support clang compatible [[musttail]] (PR83324) To: Andi Kleen Cc: gcc-patches@gcc.gnu.org References: <20240505181458.2903045-1-ak@linux.intel.com> <20240505181458.2903045-2-ak@linux.intel.com> <13a46de1-6551-4ff4-abac-2269e587d857@redhat.com> From: Jason Merrill In-Reply-To: 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.8 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/14/24 13:24, Andi Kleen wrote: > Hi Jason, > > On Mon, May 06, 2024 at 11:02:20PM -0400, Jason Merrill wrote: >>> @@ -30189,7 +30207,7 @@ cp_parser_std_attribute (cp_parser *parser, tree attr_ns) >>> /* Maybe we don't expect to see any arguments for this attribute. */ >>> const attribute_spec *as >>> = lookup_attribute_spec (TREE_PURPOSE (attribute)); >>> - if (as && as->max_length == 0) >>> + if ((as && as->max_length == 0) || is_attribute_p ("musttail", attr_id)) >> >> I'd prefer to add an attribute to the table, rather than special-case it >> here; apart from consistency, it seems likely that someone will later want >> to apply it to a function. > > Just to clarify. I can add it to the table, but it would be a nop there > for now because the table is not used for statement attributes by > the current parser. Agreed. >> You need a template testcase; I expect it doesn't work in templates with the >> current patch. It's probably enough to copy it in tsubst_expr where we >> currently propagate CALL_EXPR_OPERATOR_SYNTAX. > > I tried it with the appended test case, everything seems to work without > changes. > > Does it cover the cases you were concerned about? Not fully; this testcase doesn't seem to check for errors if tail-call fails, only whether the syntax is accepted. So it would pass if the attribute were simply ignored. Did you also see this comment? > It seems to me that if we were to pass &std_attrs to cp_parser_jump_statement, we could handle this entirely in that function rather than adding a flag to finish_return_stmt and check_return_stmt. Jason