https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112434
--- Comment #4 from Levi Zim <rsworktech at outlook dot com> --- I think the fix should be easy and this kind of bug has been fixed for aarch64(in f541a48127a1940dce8dc8f48d88ccb04aa2a31e) and loongarch(c44fd55784206ff5b32471dadaa8affbac840454). Based on c44fd55784206ff5b32471dadaa8affbac840454 I made a patch and tested it by building riscv64-linux-gnu-gcc and compile the attached source file. It works. But the steps of sending a patch to gcc seems too complex for me so I am attaching it here for now.