FWIW, I have found that the GCC mingw-w64 packaged releases from winlibs.com to work fine with Codeblocks 20.03.
I download a zip and unpack, for example, so that the compiler's installation directory is
C:\Program Files\mingw-w64\winlibs-x86_64-posix-seh-gcc-9.3.0-llvm-10.0.0-mingw-w64-7.0.0-r4\mingw64
Don't press the autodetect button! The defaults for Program Files work OK.
I also do similarly for the 8.1, 9.2 and 10. snapshot version so that I have all the latest GCC versions working fine. (Clang /LLVM also work similarly).
HTH