From: Andi Kleen <ak@linux.intel.com>
To: Joseph Myers <josmyers@redhat.com>
Cc: gcc-patches@gnu.org
Subject: Re: Updated musttail patches
Date: Fri, 2 Feb 2024 06:49:14 -0800 [thread overview]
Message-ID: <Zb0A6qLiGr5pNx1f@tassilo> (raw)
In-Reply-To: <8cdcb471-a75f-3a4c-32cf-3caba0433abb@redhat.com>
On Fri, Feb 02, 2024 at 01:18:06PM +0000, Joseph Myers wrote:
> On Fri, 2 Feb 2024, Andi Kleen wrote:
>
> > This patchkit implements a [[musttail]] attribute for C/C++.
> >
> > v4:
> > Addressed all feedback except clang::musttail is still supported
> > (I don't want to force an #ifdef to most users) and I'm also still
>
> I'm fine with supporting [[clang::musttail]]. What shouldn't be supported
> is plain unnamespaced [[musttail]], at least for C, and I don't see any
It's unsupported since v4 ("" -> "gnu" for the lookups)
> tests that that's not supported (there are tests of [[musttail]] on things
> that aren't returns, but that's mixing two different issues -
> [[gnu::musttail]] shouldn't be accepted on non-returns, while [[musttail]]
> shouldn't be accepted anywhere, including on returns, because it's not a
> standard attribute).
I added some extra tests for this (passing)
diff --git a/gcc/testsuite/c-c++-common/musttail5.c b/gcc/testsuite/c-c++-common/musttail5.c
index 71f4de40fc6d..7938e7ff80e4 100644
--- a/gcc/testsuite/c-c++-common/musttail5.c
+++ b/gcc/testsuite/c-c++-common/musttail5.c
@@ -19,7 +19,10 @@ int foo2(int p)
int i;
-void foo3(void)
+int foo3(void)
{
[[musttail]] i++; /* { dg-warning "attribute" } */
+ [[musttail]] if (i > 10) /* { dg-warning "attribute" } */
+ [[musttail]] return foo2(i); /* { dg-warning "attribute" } */
+ return 0;
}
prev parent reply other threads:[~2024-02-02 14:49 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 9:09 Andi Kleen
2024-02-02 9:09 ` [PATCH v4 1/5] Improve must tail in RTL backend Andi Kleen
2024-02-02 9:09 ` [PATCH v4 2/5] C++: Support clang compatible [[musttail]] (PR83324) Andi Kleen
2024-02-02 9:09 ` [PATCH v4 3/5] C: Implement musttail attribute for returns Andi Kleen
2024-02-02 9:09 ` [PATCH v4 4/5] Add tests for C/C++ musttail attributes Andi Kleen
2024-02-02 11:01 ` Prathamesh Kulkarni
2024-02-02 14:50 ` Andi Kleen
2024-02-02 9:09 ` [PATCH v4 5/5] Add documentation for musttail attribute Andi Kleen
2024-02-04 4:35 ` Sandra Loosemore
2024-02-05 13:32 ` Andi Kleen
2024-02-02 13:18 ` Updated musttail patches Joseph Myers
2024-02-02 14:49 ` Andi Kleen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Zb0A6qLiGr5pNx1f@tassilo \
--to=ak@linux.intel.com \
--cc=gcc-patches@gnu.org \
--cc=josmyers@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).