public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "simon.willcocks at gmx dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/101422] register variable uninitialised before passing to asm
Date: Sun, 11 Jul 2021 19:13:44 +0000	[thread overview]
Message-ID: <bug-101422-4-HyA07zqwEh@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101422-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #5 from Simon Willcocks <simon.willcocks at gmx dot de> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Simon Willcocks from comment #2)
> > That's not an accurate description of the problem; the value of the variable
> > is being passed, not its address. As a register variable, it doesn't have an
> > address.
> 
> It is the address of the array that is being passed (I was copying and
> pasting from another bug).
> register uint32_t *cap_and_join asm( "r5" ) = cap_and_join_style;
> Is the same as:
> register uint32_t *cap_and_join asm( "r5" ) = &cap_and_join_style[0];
> 
> Because array decays to pointers :).

I know. I've been doing this for a while, now. *That* register variable and the
array it pointed to were correctly initialised. r0-r3 are clobbered by any
function call, although I didn't program a function call, the compiler did.

  parent reply	other threads:[~2021-07-11 19:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-11 18:23 [Bug c/101422] New: " simon.willcocks at gmx dot de
2021-07-11 18:30 ` [Bug inline-asm/101422] " pinskia at gcc dot gnu.org
2021-07-11 18:51 ` simon.willcocks at gmx dot de
2021-07-11 18:52 ` simon.willcocks at gmx dot de
2021-07-11 18:59 ` pinskia at gcc dot gnu.org
2021-07-11 19:13 ` simon.willcocks at gmx dot de [this message]
2021-07-12  8:14 ` jakub at gcc dot gnu.org
2021-07-12 13:02 ` simon.willcocks at gmx dot de
2021-07-15 11:41 ` simon.willcocks at gmx dot de

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-101422-4-HyA07zqwEh@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).