From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9DA513851C18; Sun, 11 Jul 2021 19:13:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DA513851C18 From: "simon.willcocks at gmx dot de" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: inline-asm X-Bugzilla-Version: 10.3.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.willcocks at gmx dot de X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jul 2021 19:13:44 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101422 --- Comment #5 from Simon Willcocks --- (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 var= iable > > is being passed, not its address. As a register variable, it doesn't ha= ve an > > address. >=20 > 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" ) =3D cap_and_join_style; > Is the same as: > register uint32_t *cap_and_join asm( "r5" ) =3D &cap_and_join_style[0]; >=20 > 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.=