public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: Richard Biener <richard.guenther@gmail.com>,
	"H.J. Lu" <hjl.tools@gmail.com>, Hongtao Liu <crazylht@gmail.com>,
	Uros Bizjak <ubizjak@gmail.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] i386: Guard noreturn no-callee-saved-registers optimization with -mnoreturn-no-callee-saved-registers [PR38534]
Date: Thu, 29 Feb 2024 16:10:27 +0100	[thread overview]
Message-ID: <ZeCeYwWJ0KB9i5Mz@tucnak> (raw)
In-Reply-To: <ZeCRgihGGjfRKTKT@kam.mff.cuni.cz>

On Thu, Feb 29, 2024 at 03:15:30PM +0100, Jan Hubicka wrote:
> I am not wed to the idea (just it appeared to me as an option to
> disabling this optimization by default). I still think it may make sense.

Maybe I misunderstood your idea.
So, you are basically suggesting to go in a completely opposite direction
from H.J.'s changes, instead of saving less in noreturn prologues, save
more, most likely not change anything in code generation on the caller's
side (nothing is kept alive across visible unconditional noreturn calls)
and maybe after some time use normally caller-saved registers in say call
frame debug info for possible use in DW_OP_entry_value (but in that case it
is an ABI change) and improve debuggability of vars which live in normally
caller-saved registers right before a noreturn call in that frame?
What about registers in which function arguments are passed?

If it is done as a change with no changes at all on the caller side and
just on the callee side, it could again be guarded by some option (not sure
what the default would be) where the user could increase debuggability of
the noreturn caller (in that case always necessarily just a single immediate
one; while not doing the callee saved register saves improves debuggability
in perhaps multiple routines in the call stack, depending on which registers
wouldn't be saved and which registers are used in each of the caller frames;
e.g. noreturn function could save/not save all of %rbx, %r1[2345], one
caller somewhere use %r12, another %rbx and %r13, yet another one %r14 and
%r15).

	Jakub


  parent reply	other threads:[~2024-02-29 15:10 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  8:40 [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116] Jakub Jelinek
2024-02-27  8:54 ` Richard Biener
2024-02-27  9:04   ` Jakub Jelinek
2024-02-27  9:13     ` Jakub Jelinek
2024-02-27  9:50       ` Richard Biener
2024-02-27  9:55       ` Jakub Jelinek
2024-02-27 12:09       ` Jakub Jelinek
2024-02-27 14:57         ` [PATCH] i386: Guard noreturn no-callee-saved-registers optimization with -mnoreturn-no-callee-saved-registers [PR38534] Jakub Jelinek
2024-02-28  8:00           ` Jakub Jelinek
2024-02-28  8:53             ` Jakub Jelinek
2024-02-29  6:20               ` Hongtao Liu
2024-02-29 12:26                 ` H.J. Lu
2024-02-29 12:47                   ` Jakub Jelinek
2024-02-29 13:24                     ` Richard Biener
2024-02-29 13:31                       ` Jan Hubicka
2024-02-29 13:56                         ` Jakub Jelinek
2024-02-29 14:15                           ` Jan Hubicka
2024-02-29 14:28                             ` H.J. Lu
2024-02-29 15:10                             ` Jakub Jelinek [this message]
2024-02-29 15:26                               ` Jan Hubicka
2024-03-05  4:52                 ` Hongtao Liu
2024-02-29 16:25         ` [PATCH] i386: For noreturn functions save at least the bp register if it is used [PR114116] Michael Matz

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=ZeCeYwWJ0KB9i5Mz@tucnak \
    --to=jakub@redhat.com \
    --cc=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=hubicka@ucw.cz \
    --cc=richard.guenther@gmail.com \
    --cc=ubizjak@gmail.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).