https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102892
--- Comment #13 from palmer at gcc dot gnu.org --- I just posted a patch <https://gcc.gnu.org/pipermail/gcc-patches/2022-May/593995.html> that removes the undefined behavior from this test case, with that it links on RISC-V.