public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/106338] New: RISC-V static-chain register may be clobbered by PLT stubs
@ 2022-07-18  8:00 funanzeng at gmail dot com
  2022-07-18  8:12 ` [Bug target/106338] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: funanzeng at gmail dot com @ 2022-07-18  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106338
           Summary: RISC-V static-chain register may be clobbered by PLT
                    stubs
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: funanzeng at gmail dot com
  Target Milestone: ---

In commit 09cae7507d9e88f2b05cf3a9404bf181e65ccbac, Palmer ported GCC to RISC-V
and t2 were chosen as the static chain register. However, when I supporting
this feature in LLVM(https://reviews.llvm.org/D129106), jrtc27 pointed out that
this issue.

In practice, static chain parameters are only used in Go and is always used
with closures, where the function pointer is already resolved. As a result,
this issue may not be triggered unless a user directly calls a foreign function
with a static chain parameter, and thus has not caused any problem.

FYI, in a recent change to the RISC-V ABI, STO_RISCV_VARIANT_CC was added to
support unknown ABI.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-08-10  2:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18  8:00 [Bug target/106338] New: RISC-V static-chain register may be clobbered by PLT stubs funanzeng at gmail dot com
2022-07-18  8:12 ` [Bug target/106338] " pinskia at gcc dot gnu.org
2022-07-18  8:13 ` pinskia at gcc dot gnu.org
2022-07-18  8:17 ` schwab@linux-m68k.org
2022-08-09 19:47 ` pinskia at gcc dot gnu.org
2022-08-09 21:11 ` andrew at sifive dot com
2022-08-10  2:58 ` kito at gcc dot gnu.org

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).