GCC doesn’t parse assembly, it merely generates it and, if you compile to a binary object (which Compiler Explorer does not do by default) will invoke the assembler on it, which would give an error that you’re trying to use a register operand as the immediate value for li if enabled. Clang/LLVM, meanwhile, will parse the assembly even if it’s emitting assembly again, using its integrated assembler (contrasting with GCC where the assembler is a separate program from a separate project, binutils) and so always gives that error. Your code is wrong and neither toolchain will produce an object file for it, but GCC will let you produce assembly for it.