From: Andi Kleen
So far they are mostly i386 target specific. Later they could
be moved up to architecture specific if some other architecture
adds vartracing. This would need abstracing the scanning
for the trace function.
gcc/testsuite/:
2019-11-10 Andi Kleen
* g++.dg/vartrace-3
From: Andi Kleen
[v4: Rebased on current tree. Avoid some redundant log statements
for locals and a few other fixes. Fix some comments. Improve
documentation. Did some studies on the debug information quality,
see below]
Add a new pass to automatically instrument changes to variables
with the
From: Andi Kleen
By popular demand, I did some updates to the git documentation how
to use --reference to save disk space.
Also recommend https instead of http (even though both are currently
broken)
---
htdocs/git.html | 15 ---
1 file changed, 12 insertions(+), 3 deletions
On Sun, Jan 12, 2020 at 08:51:28PM +0100, Andreas Schwab wrote:
> On Jan 12 2020, Andi Kleen wrote:
>
> > By popular demand, I did some updates to the git documentation how
> > to use --reference to save disk space.
>
> I would advice against using --reference. Now
On Sun, Jan 12, 2020 at 09:51:22PM +0100, Gerald Pfeifer wrote:
> On Sun, 12 Jan 2020, Andi Kleen wrote:
> > By popular demand, I did some updates to the git documentation how
> > to use --reference to save disk space.
> >
> > Also recommend https instead of http (eve
Andi Kleen writes:
Ping!
> Andi Kleen writes:
>
> Ping!
>
>> Andi Kleen writes:
>>
>> Ping!
>>
>>> From: Andi Kleen
>>>
>>> [v4: Rebased on current tree. Avoid some redundant log statements
>>> for locals and a few othe
Martin Liška writes:
>
> Notes and limitations:
> - The call-chain-clustering algorithm requires to fit as many as possible
> functions into page size (4K).
> Based on my measurements that should correspond to ~1000 GIMPLE statements
> (IPA inliner size). I can
> make it a param in the futur
Andi Kleen writes:
Ping!
> Andi Kleen writes:
>
> Ping!
>
>> Andi Kleen writes:
>>
>> Ping!
>>
>>> Andi Kleen writes:
>>>
>>> Ping!
>>>
>>>> From: Andi Kleen
>>>>
>>>> [v4: Rebased on
Andi Kleen writes:
Ping!
> Andi Kleen writes:
>
> Ping!
>
>> Andi Kleen writes:
>>
>> Ping!
>>
>>> Andi Kleen writes:
>>>
>>> Ping!
>>>
>>>> Andi Kleen writes:
>>>>
>>>> Ping
musttail support for C/C++
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643867.html
Support constexpr for asm statements in C++
https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643933.html
Andrew Pinski writes:
> On Thu, Mar 14, 2024 at 9:36 PM Andi Kleen wrote:
>>
>>
>> musttail support for C/C++
>>
>> https://gcc.gnu.org/pipermail/gcc-patches/2024-January/643867.html
>>
>>
>> Support constexpr for asm statements in C++
&
Thanks Jakub.
> > +/* Parse a string literal or constant expression yielding a string.
> > + The constant expression uses extra parens to avoid ambiguity with "x"
> > (expr).
> > +
> > + asm-string-expr:
> > + string-literal
> > + ( constant-expr ) */
> > +
> > +static tree
> > +cp_pa
> > I think keeping it untranslated is fine for now. Any translation
> > if really needed would be a separate feature.
>
> I mean, unless you make extra effort, it is translated.
> Even in your current version, try constexpr *foo () { return "nop"; }
> and you'll see that it actually results in "\
> This results in "error: cannot tail-call: cannot tail-call: other reasons".
> So the second argument should be "other reasons" only.
Yes will fix those. Thanks.
>
> I notice that if I don't use -O2 I also get "other reasons". But it should be
> easy-ish to say "cannot tail-call: optimizations
> > For compatibility it also detects clang::musttail
>
> FWIW, it's not clear to me we should do this. I don't see a precedent.
It would make existing code just work (as long as they don't use ifdef)
>
> > One problem is that tree-tailcall usually fails when optimization
> > is disabled, whic
> This will run the test only once with -std=c++11. We'll get better coverage
> with dropping the line above and using
>
> /* { dg-do compile { target { tail_call && { c || c++11 } } } } */
>
> but here it may not matter.
The problem is that older C/C++ standards don't support [[]] attributes.
- Give error messages for all causes of non sibling call generation
- Don't override choices of other non sibling call checks with
must tail. This causes ICEs. The must tail attribute now only
overrides flag_optimize_sibling_calls locally.
- Error out when tree-tailcall failed to mark a must-tail c
Mostly adopted from the existing C musttail plugin tests.
gcc/testsuite/ChangeLog:
* c-c++-common/musttail1.c: New test.
* c-c++-common/musttail2.c: New test.
* c-c++-common/musttail3.c: New test.
* c-c++-common/musttail4.c: New test.
* c-c++-common/musttai
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
using the lookup/remove_attributes (not clear if anything else
is worth it and it would certainly be
gcc/ChangeLog:
* doc/extend.texi: Document [[musttail]]
---
gcc/doc/extend.texi | 16
1 file changed, 16 insertions(+)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 142e41ab8fbf..866f6c4a9fed 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -9
Implement a C23 clang compatible musttail attribute similar to the earlier
C++ implementation in the C parser.
PR83324
gcc/c/ChangeLog:
* c-parser.cc (struct attr_state): Define with musttail_p.
(c_parser_statement_after_labels): Handle [[musttail]]
(c_parser_std_
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes problems with register allocation and other per function
optimizati
On Fri, Feb 02, 2024 at 01:18:06PM +, 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 d
> Sorry, I wasn't clear about this in previous patch -- noipa will
> subsume other ipa attributes,
> so there's no need to have noinline, noclone along with noipa.
> int __attribute__((noipa)) callee(int i) should be sufficient for
> disabling IPA optimizations involving callee.
I thought you were
On Sat, Feb 03, 2024 at 09:35:43PM -0700, Sandra Loosemore wrote:
> On 2/2/24 02:09, Andi Kleen wrote:
> > gcc/ChangeLog:
> >
> > * doc/extend.texi: Document [[musttail]]
> > ---
> > gcc/doc/extend.texi | 16
> > 1 file changed, 16
Hongtao Liu writes:
>>
>> +@opindex mapx-inline-asm-use-gpr32
>> +@item -mapx-inline-asm-use-gpr32
>> +When APX_F enabled, EGPR usage was by default disabled to prevent
>> +unexpected EGPR generation in instructions that does not support it.
>> +To invoke EGPR usage in inline asm, use this switch
- Give error messages for all causes of non sibling call generation
- Don't override choices of other non sibling call checks with
must tail. This causes ICEs. The must tail attribute now only
overrides flag_optimize_sibling_calls locally.
- Error out when tree-tailcall failed to mark a must-tail c
Mostly adopted from the existing C musttail plugin tests.
---
gcc/testsuite/g++.dg/musttail1.C | 15
gcc/testsuite/g++.dg/musttail2.C | 35 ++
gcc/testsuite/g++.dg/musttail3.C | 42
gcc/testsuite/g++.dg/musttail4.C | 19
---
gcc/doc/extend.texi | 19 ++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 0bc586d120e7..444b68f5d071 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -27890,7 +27890,8 @@ Predefined Macros,cpp,The GN
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes problems with register allocation and other per function
optimizati
> ...are the three hunks above needed? The reason for asking is that,
> if they were needed, I'd have expected that we'd also need a table
> entry for clang::musttail (which is possible to add). But trying it
> locally, the patch seemed to work without this.
Interesting thanks. I think I copied
On Wed, Jan 24, 2024 at 11:13:44AM +, Sam James wrote:
>
> Andi Kleen writes:
>
> > This patch implements a clang compatible [[musttail]] attribute for
> > returns.
>
> This is PR83324. See also PR52067 and PR110899.
Thanks for the references. I'll add i
This version addresses all the feedback so far (Thanks!). The largest
change is support for using [[musttail]] in C23, not just C++.
-Andi
- Give error messages for all causes of non sibling call generation
- Don't override choices of other non sibling call checks with
must tail. This causes ICEs. The must tail attribute now only
overrides flag_optimize_sibling_calls locally.
- Error out when tree-tailcall failed to mark a must-tail c
Implement a C23 clang compatible musttail attribute similar to the earlier
C++ implementation in the C parser.
---
gcc/c/c-parser.cc | 59 +--
gcc/c/c-tree.h| 2 +-
gcc/c/c-typeck.cc | 15 ++--
3 files changed, 61 insertions(+), 15 deletions
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes problems with register allocation and other per function
optimizati
---
gcc/doc/extend.texi | 16
1 file changed, 16 insertions(+)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 0bc586d120e7..c68d32bed8de 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -9867,6 +9867,22 @@ foo (int x, int y)
@code{y} is not actually in
Mostly adopted from the existing C musttail plugin tests.
---
gcc/testsuite/c-c++-common/musttail1.c | 17
gcc/testsuite/c-c++-common/musttail2.c | 36 ++
gcc/testsuite/c-c++-common/musttail3.c | 31 ++
gcc/testsuite/c-c++-common/musttail4.c
On Thu, Jan 25, 2024 at 07:51:21AM +0100, rep.dot@gmail.com wrote:
> On 24 January 2024 20:30:45 CET, Andi Kleen wrote:
> >---
> > gcc/doc/extend.texi | 16
> > 1 file changed, 16 insertions(+)
> >
> >diff --git a/gcc/doc/extend.texi b/gcc/doc/
Some programing styles use a lot of inline assembler, and it is common
to use very complex preprocessor macros to generate the assembler
strings for the asm statements. In C++ there would be a typesafe alternative
using templates and constexpr to generate the assembler strings, but
unfortunately th
On Thu, Jan 25, 2024 at 08:08:23PM +, Joseph Myers wrote:
> On Wed, 24 Jan 2024, Andi Kleen wrote:
>
> > Implement a C23 clang compatible musttail attribute similar to the earlier
> > C++ implementation in the C parser.
>
> I'd expect diagnostics, and associat
> > I don't have tests for that but since it's not new behavior I suppose
> > that's sufficient.
>
> Each attribute should have tests that invalid uses are appropriately
> diagnosed. See gcc.dg/c23-attr-fallthrough-2.c for examples of such tests
> in the case of the [[fallthrough]] attribute.
Fixed all earlier review comments.
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes problems with register allocation and other per function
optimizati
- Give error messages for all causes of non sibling call generation
- Don't override choices of other non sibling call checks with
must tail. This causes ICEs. The must tail attribute now only
overrides flag_optimize_sibling_calls locally.
- Error out when tree-tailcall failed to mark a must-tail c
Mostly adopted from the existing C musttail plugin tests.
---
gcc/testsuite/c-c++-common/musttail1.c | 17
gcc/testsuite/c-c++-common/musttail2.c | 36 +
gcc/testsuite/c-c++-common/musttail3.c | 31 +
gcc/testsuite/c-c++-common/musttail4.
Implement a C23 clang compatible musttail attribute similar to the earlier
C++ implementation in the C parser.
---
gcc/c/c-parser.cc | 61 +--
gcc/c/c-tree.h| 2 +-
gcc/c/c-typeck.cc | 15 ++--
3 files changed, 63 insertions(+), 15 deletions
---
gcc/doc/extend.texi | 16
1 file changed, 16 insertions(+)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 0bc586d120e7..1d413b0ef6d1 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -9867,6 +9867,22 @@ foo (int x, int y)
@code{y} is not actually in
Andi Kleen writes:
I wanted to ping this patch kit to add musttail support for C/C++,
to enable future python versions and other users and keep up with clang.
https://gcc.gnu.org/pipermail/gcc-patches/2024-June/thread.html#655447
It unfortunately touches various different parts of the
liuhongt writes:
> From: "H.J. Lu"
>
> According to Intel® 64 and IA-32 Architectures Optimization Reference
> Manual[1], Branch Hint is updated for Redwood Cove.
>
> cut from [1]-
> Starting with the Redwood Cove microarchitecture, if the predictor has
> no store
> > +class pass_musttail : public gimple_opt_pass
> > +{
> > +public:
> > + pass_musttail (gcc::context *ctxt)
> > +: gimple_opt_pass (pass_data_musttail, ctxt)
> > + {}
> > +
> > + /* opt_pass methods: */
> > + /* This pass is only used when not optimizing to make [[musttail]] still
> > +
On Fri, Jul 05, 2024 at 12:44:47PM +0200, Richard Biener wrote:
> On Sat, Jun 22, 2024 at 8:57 PM Andi Kleen wrote:
> >
> > It does nothing currently since statement attributes are handled
> > directly in the parser.
>
> Is this needed at all? a "'musttail
On Fri, Jul 05, 2024 at 01:45:17PM +0200, Richard Biener wrote:
> On Sat, Jun 22, 2024 at 9:00 PM Andi Kleen wrote:
> >
> > Move the error reporting for caller attributes to be
> > after the tail call discovery, so that we can give proper
> > error messages tagged to
> >if (!single_succ_p (bb))
> > -return;
> > +{
> > + int num_eh, num_other;
> > + bb_get_succ_edge_count (bb, num_eh, num_other);
> > + /* Allow EH edges so that we can give a better
> > +error message later. */
>
> Please instead use has_abnormal_or_eh_outgoin
On Mon, Jul 08, 2024 at 08:53:27AM +0200, Richard Biener wrote:
> Ah, I see. So this pass is responsible for both -O0 and
> -fno-optimized-sibling-calls.
> But I'm quite sure the other pass doesn't run with -O0
> -foptimize-sibling-calls, does it?
It does run:
./cc1 -O0 -fdump-passes -foptimize-
> > Overall the logic in this pass is rather convoluted and
> > could deserve some cleanups and separation of concerns.
> > e.g. it would be better to separate tail calls and tail
> > recursion. But I'm not trying to rewrite the pass here.
>
> Understood. For a v9, can you squash the tree-tailcal
On Mon, Jul 08, 2024 at 09:06:21AM +0200, Richard Biener wrote:
> On Sat, Jul 6, 2024 at 8:45 PM Andi Kleen wrote:
> >
> > > >if (!single_succ_p (bb))
> > > > -return;
> > > > +{
> > > > + int num_eh, num_other;
>
> I have added a target hook for this in v4 of this patch. The hook
> receives all the information about the stores, the load, the estimated
> sequence cost and whether we expect to eliminate the load. With this
> information the target should be able to make an informed decision.
>
> What you men
On Mon, Jul 08, 2024 at 05:27:53PM +0200, Richard Biener wrote:
>
>
> > Am 08.07.2024 um 17:22 schrieb Andi Kleen :
> >
> > On Mon, Jul 08, 2024 at 08:53:27AM +0200, Richard Biener wrote:
> >> Ah, I see. So this pass is responsible for both -O0 and
> >&
Some of the cfg fixups in pro_and_epilogue for sibcalls were dependent on
"optimize".
Make them check cfun->tail_call_marked instead to handle the -O0 musttail
case. This fixes the musttail test cases on arm targets.
gcc/ChangeLog:
PR target/115255
* function.cc (thread_prologue_
The actual handling is directly in the parser since the
generic mechanism doesn't support statement attributes,
but this gives basic error checking/detection on the attribute.
gcc/c-family/ChangeLog:
PR83324
* c-attribs.cc (handle_musttail_attribute): Add.
* c-common.h (ha
This version addresses all the review feedback (Thanks everyone!)
It is getting close to the finish line. The only missing reviews now
are for the C frontend part (patch 5). Joseph and Marek, I would
appreciate if you could take a look.
- Addressed Richie's feedback with various improvements
and
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes problems with register allocation and other per function
optimizati
Enable the tailcall optimization for non optimizing builds,
but in this case only checks calls that have the musttail attribute set.
This makes musttail work without optimization.
This is done with a new late musttail pass that is only active when
not optimizing. The new pass relies on tree-cfg to
- Give error messages for all causes of non sibling call generation
- When giving error messages clear the musttail flag to avoid ICEs
- Error out when tree-tailcall failed to mark a must-tail call
sibcall. In this case it doesn't know the true reason and only gives
a vague message.
PR8332
When musttail is set, make tree-tailcall give error messages
when it cannot handle a call. This avoids vague "other reasons"
error messages later at expand time when it sees a musttail
function not marked tail call.
In various cases this requires delaying the error until
the call is discovered.
A
gcc/ChangeLog:
PR83324
* doc/extend.texi: Document [[musttail]]
---
gcc/doc/extend.texi | 25 +++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index b2e41a581dd1..f83e643da19c 100644
--- a/gcc/doc/ex
Some adopted from the existing C musttail plugin tests.
gcc/testsuite/ChangeLog:
* c-c++-common/musttail1.c: New test.
* c-c++-common/musttail2.c: New test.
* c-c++-common/musttail3.c: New test.
* c-c++-common/musttail4.c: New test.
* c-c++-common/musttail7
Implement a C23 clang compatible musttail attribute similar to the earlier
C++ implementation in the C parser.
PR83324
gcc/c/ChangeLog:
* c-parser.cc (struct attr_state): Define with musttail_p.
(c_parser_statement_after_labels): Handle [[musttail]]
(c_parser_std_
The musttail error messages are reported to the user, so must be
translated.
gcc/ChangeLog:
PR83324
* calls.cc (initialize_argument_information): Mark messages
for translation.
(can_implement_as_sibling_call_p): Dito.
(expand_call): Dito.
---
gcc/calls.cc
Here's an updated patch with your feedback addressed.
Is this version ok?
The common code is in the C++ patch.
---
Implement a C23 clang compatible musttail attribute similar to the earlier
C++ implementation in the C parser.
gcc/c/ChangeLog:
PR c/83324
* c-parser.cc (struct
Updated version with common code for C/C++ extracted in c-family.
Other than that no changes.
Is this version ok to commit?
---
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed go
On Mon, Jul 15, 2024 at 06:57:57PM -0400, Jason Merrill wrote:
> On 7/8/24 12:56 PM, Andi Kleen wrote:
> > diff --git a/gcc/testsuite/g++.dg/musttail10.C
> > b/gcc/testsuite/g++.dg/musttail10.C
> > new file mode 100644
> > index ..9b7043b8a306
> > ---
> In the adjusted test it looks like the types of f and g match, so I wouldn't
> expect an error.
Good point! Missing the forest for the trees.
Anyways are the C++ patches ok with this change?
Thanks,
-Andi
On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote:
> On 7/16/24 11:15 AM, Andi Kleen wrote:
> > > In the adjusted test it looks like the types of f and g match, so I
> > > wouldn't
> > > expect an error.
> >
> > Good point! Missing the f
On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote:
> On 7/16/24 12:18 PM, Andi Kleen wrote:
> > On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote:
> > > On 7/16/24 11:15 AM, Andi Kleen wrote:
> > > > > In the adjusted test it looks like
On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote:
> On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote:
> > On 7/16/24 12:18 PM, Andi Kleen wrote:
> > > On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote:
> > > > On 7/16/24 11:15 AM, An
On Tue, Jul 16, 2024 at 06:06:42PM -0400, Jason Merrill wrote:
> On 7/16/24 5:55 PM, Andi Kleen wrote:
> > On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote:
> > > On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote:
> > > > On 7/16/24 12:18 PM,
> Great. Does it also work in a non-template function?
Sadly it did not because there needs to be more AGGR_VIEW_EXPR handling,
as you predicted at some point. I fixed it now. Will send updated patches.
-Andi
This patchkit contains the remaining C/C++ frontend patches for the
[[musttail]]
extension that still need approval for trunk. I already committed
the tree-ssa and RTL pieces.
C: I addressed Marek's feedback, but need final ack. Marek can you
please take a look?
C++: Fixed support for AGGR_VIEW
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes problems with register allocation and other per function
optimizati
Implement a C23 clang compatible musttail attribute similar to the earlier
C++ implementation in the C parser.
gcc/c/ChangeLog:
PR c/83324
* c-parser.cc (struct attr_state): Define with musttail_p.
(c_parser_statement_after_labels): Handle [[musttail]].
(c_parser_s
Some adopted from the existing C musttail plugin tests.
Also extends the ability to query the sibcall capabilities of the
target.
gcc/testsuite/ChangeLog:
* testsuite/lib/target-supports.exp
(check_effective_target_struct_tail_call): New function.
* c-c++-common/musttail1.
On Thu, Jul 18, 2024 at 02:19:21PM -0400, Marek Polacek wrote:
> On Wed, Jul 17, 2024 at 09:30:00PM -0700, Andi Kleen wrote:
> > Implement a C23 clang compatible musttail attribute similar to the earlier
> > C++ implementation in the C parser.
> >
> > gcc/c/ChangeL
> > > > + set_musttail_on_return (retval, xloc, musttail_p);
> > > > +
> > > >if (retval)
> > > > {
> > > >tree semantic_type = NULL_TREE;
> > >
> > > Is it deliberate that set_musttail_on_return is called outside the
> > > if (retval) block? If it can be moved into it, set_must
Updated patch with the !retval bug fix identified by Marek.
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes pr
> Looks generally OK though does this mean people can debug
> programs using [[gnu::musttail]] only with optimized builds? It
> seems to me we should try harder to make [[gnu::musttail]] work
> at -O0 and generally behave the same at all optimization levels?
Yes that's a fair point. The problem i
> > diff --git a/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
> > b/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
> > index 3a6d4cceaba7..44af361e2925 100644
> > --- a/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
> > +++ b/gcc/testsuite/gcc.dg/plugin/must-tail-call-1.c
> > @@ -1,4 +1,5 @@
> >
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
> > = looku
> > > 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 with
On Tue, May 14, 2024 at 04:15:08PM +0200, Richard Biener wrote:
> On Sun, May 5, 2024 at 8:16 PM Andi Kleen wrote:
> >
> > - Give error messages for all causes of non sibling call generation
> > - Don't override choices of other non sibling call checks with
> >
> I can't see how this triggers on the IL above, the loop should have
> ignored both the return and the clobber and when recursing to
> the predecessor stop before the above check when runnig into the
> call?
Yes, I tracked that down later. The problem was that there
were multiple successors to th
I reworked the musttail patchkit to make it work without optimization
and also give better error messages and fixed some bugs and increased
the test coverage.
The no optimization support is not perfect: it cannot handle returning
small structures which would need to be allocated to registers first
This patch implements a clang compatible [[musttail]] attribute for
returns.
musttail is useful as an alternative to computed goto for interpreters.
With computed goto the interpreter function usually ends up very big
which causes problems with register allocation and other per function
optimizati
Implement a C23 clang compatible musttail attribute similar to the earlier
C++ implementation in the C parser.
PR83324
gcc/c/ChangeLog:
* c-parser.cc (struct attr_state): Define with musttail_p.
(c_parser_statement_after_labels): Handle [[musttail]]
(c_parser_std_
- Give error messages for all causes of non sibling call generation
- When giving error messages clear the musttail flag to avoid ICEs
- Error out when tree-tailcall failed to mark a must-tail call
sibcall. In this case it doesn't know the true reason and only gives
a vague message.
PR8332
It does nothing currently since statement attributes are handled
directly in the parser.
gcc/c-family/ChangeLog:
* c-attribs.cc (handle_musttail_attribute): Add.
* c-common.h (handle_musttail_attribute): Add.
---
gcc/c-family/c-attribs.cc | 15 +++
gcc/c-family/c-comm
Mostly adopted from the existing C musttail plugin tests.
gcc/testsuite/ChangeLog:
* c-c++-common/musttail1.c: New test.
* c-c++-common/musttail2.c: New test.
* c-c++-common/musttail3.c: New test.
* c-c++-common/musttail4.c: New test.
* c-c++-common/musttai
When musttail is set, make tree-tailcall to give error messages
when it cannot handle a call. This avoids vague "other reasons"
error messages later at expand time.
This doesn't always work, for example when find_tail_call
walking gives up because the control flow is too complicated
then it won't
1 - 100 of 863 matches
Mail list logo