public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/strub)] attempt to satisfy/retain tail-call requirements/optimizations
@ 2021-08-11 21:10 Alexandre Oliva
  0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2021-08-11 21:10 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:d75c18e53d6bd29da8bf65e53e6c04b9cf48ceb0

commit d75c18e53d6bd29da8bf65e53e6c04b9cf48ceb0
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Aug 11 18:08:44 2021 -0300

    attempt to satisfy/retain tail-call requirements/optimizations

Diff:
---
 gcc/ipa-strub.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gcc/ipa-strub.c b/gcc/ipa-strub.c
index 5b87f101ef6..14374e62423 100644
--- a/gcc/ipa-strub.c
+++ b/gcc/ipa-strub.c
@@ -1730,8 +1730,11 @@ pass_ipa_strub::adjust_at_calls_call (cgraph_edge *e, int named_args)
 			     == get_pwmt ())));
 
   /* If we're already within a strub context, pass on the incoming watermark
-     pointer, and omit the enter and leave calls around the modified call.  */
-  tree swmp = ((optimize_size || optimize > 2)
+     pointer, and omit the enter and leave calls around the modified call, as an
+     optimization, or as a means to satisfy a tail-call requirement.  */
+  tree swmp = ((optimize_size || optimize > 2
+		|| gimple_call_must_tail_p (ocall)
+		|| (optimize == 2 && gimple_call_tail_p (ocall)))
 	       ? strub_watermark_parm (e->caller->decl)
 	       : NULL_TREE);
   bool omit_own_watermark = swmp;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-11 21:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 21:10 [gcc(refs/users/aoliva/heads/strub)] attempt to satisfy/retain tail-call requirements/optimizations Alexandre Oliva

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).