public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dories.spirits_0p at icloud dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/113293] Incorrect code after inlining function containing extended asm
Date: Tue, 09 Jan 2024 19:41:32 +0000	[thread overview]
Message-ID: <bug-113293-4-lLgwTYbEZu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-113293-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113293

--- Comment #4 from KBDeveloper <dories.spirits_0p at icloud dot com> ---
(In reply to Alexander Monakov from comment #3)
> (In reply to KBDeveloper from comment #2)
> > 
> > Ah, that makes sense. I had assumed that taking the address of arg would
> > force gcc to store it in memory somewhere. 
> > Is there a reason why gcc then allocates 8 bytes on the stack and fills r1
> > with sp - #7? Or is what I had just UB and gcc can do whatever?
> 
> The compiler allocates stack memory for 'arg' and passes the address of
> 'arg' to the asm; it is necessary in case the asm does something with it
> without reading 'arg' itself. One example would be installing a hardware
> watchpoint on that memory location.

That makes sense. Thanks for the explanation (and your time!)

      parent reply	other threads:[~2024-01-09 19:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 16:51 [Bug ipa/113293] New: " dories.spirits_0p at icloud dot com
2024-01-09 17:05 ` [Bug ipa/113293] " pinskia at gcc dot gnu.org
2024-01-09 17:14 ` dories.spirits_0p at icloud dot com
2024-01-09 18:27 ` amonakov at gcc dot gnu.org
2024-01-09 19:41 ` dories.spirits_0p at icloud dot com [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=bug-113293-4-lLgwTYbEZu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).