MountainRiver modifies the source code to support their extensions. Mainline GCC doesn't support WCH QingKe RISC-V XW extension at the moment.
LLVM could be a good alternative. The recent clang (starting with LLVM 19.1.0) handles it nicely.
Just add the right key to the command line: "--target=riscv32 -march=rv32imac_xwchc".