From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7802A3858422; Tue, 9 Jan 2024 17:14:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7802A3858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1704820490; bh=IXYm9VTIBHkBOZ8W5CfPj65gKKY3EzJj5O34y7FMRqA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DfQD4hw1PjCEemRUaZhpDPAYiVXrpVWcE/nzsu8mJqR1e5Vt40CHhgc9/QvfHw1Sl zeM6CPvEKNgiA+V7HuZjFk1qbrWMjLdKsGWXAk9v70K1ug8hUwHWpzXxarAS7b/z3l l64OH2W5zpnqDA/RlPNi28FiXO7AjHAl7udlp7x8= From: "dories.spirits_0p at icloud dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/113293] Incorrect code after inlining function containing extended asm Date: Tue, 09 Jan 2024 17:14:49 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: dories.spirits_0p at icloud dot com 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113293 --- Comment #2 from KBDeveloper --- (In reply to Andrew Pinski from comment #1) > The inline-asm is not marking as clobbering memory. >=20 > In this case since you just pass the address of the variable, gcc does not > know the inline-asm will read memory at all, it deletes the store. Anyways > adding "memory" as a clobber to the inline-asm, fixes the issue. Ah, that makes sense. I had assumed that taking the address of arg would fo= rce gcc to store it in memory somewhere.=20 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? At any rate, thanks for the quick response.=