From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1F6A93858C3A; Mon, 13 Nov 2023 19:18:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F6A93858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1699903111; bh=EVmdN1tnf7x9CRi/CVLVVsWMcfX65MHlmesZHcJkMx4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wZ1Nggy2z8CzWThzHrfkii0zmkbJ9TGVp5SYeBR5YFncByGqNehCSKHz4p4VaSyn3 +nLqdQGJ1s9QuzcQK5FzahDv5bg1LvdRzVjXX/pB7fVewTzqm/q0dSi34/XMXcUZg5 zoSRMlnievAAQzImbWL6mYEyJMPAMmZwwV6M/Vh8= From: "law at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/112478] riscv: asm clobbers not honored Date: Mon, 13 Nov 2023 19:18:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: law at gcc dot gnu.org 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: bug_status resolution 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=3D112478 Jeffrey A. Law changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #4 from Jeffrey A. Law --- You're using an ASM to implement a call. That means your asm is responsible for dealing with all ABI issues, including saving/restoring registers around the call. Essentially GCC has no visibility into what your ASM does. It's just a text string that gets passed through to the assembler. The fact that it worked before was more an accident than by design. Basically GCC doesn't know your ASM performs a call, so it thinks the function is a leaf. I would _strongly_ recommend you not implement calls via ASMs. I've watched developers try to do that for 30+ years. It rarely ends well.=