From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EC6443858D33; Sun, 9 Apr 2023 15:33:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC6443858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681054433; bh=edwwYW4Ag6ac2T7JobW8tHiTmI63rpOXB5DPczCx5R4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BmwlSb3MxPe9t76XcR208ldxenbXLQ8BCMAuRt4s7P7jFh2loOJDZ7EkLzjbkE2XR AqHme45NElVAkkrxHItX0YPTnI0ynGi/owFD83EKW5m/o6fh+aPs6Zv5UH2JVZwcMB 86/zEbnlMhCPWw/a+SfdlHzCmnXqs7395R3qphPU= From: "gccriscvuser at proton dot me" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109456] `-ffixed` is ignored for `a` registers on RISC-V. Date: Sun, 09 Apr 2023 15:33:53 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.1 X-Bugzilla-Keywords: inline-asm, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: gccriscvuser at proton dot me X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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=3D109456 --- Comment #1 from gccriscvuser at proton dot me --- Corrected URLs from original description: Register `a4` is normally used for passing parameters in a call. https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.a= doc As such, it would be problematic to use `a4` for a global as shown here. https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html However, if this code is compiled with `-ffixed-a4`, then `a4` should be reserved for this global register variable. https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html=