Created attachment 52503 [details] assembly file emitted by GCC When building for powerpc with -mcpu=e500mc the generated assembly includes a ".machine ppc" directive which causes gas to ignore the command line -me500mc flag. This means that it decides any e500mc specific instructions are invalid. Attached is the generated assembly from a build with gcc 11.2 cross-compiled for powerpc. As you can see the .machine directive says ppc but when gas sees this it will reset it's internal state and decide the isel instruction is invalid. I think this might be an regression from https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=2d94f7dea9. GCC only seems to have a limited set of machines it will emit which don't match with what binutils uses.
How did you configure GCC? How did you invoke GCC? Can you attach the preprocessed source rather than the generated assembly code?
GCC configure line is $ /home/ctng/crosstool-ng/.build/powerpc-unknown-linux-gnu/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=powerpc-unknown-linux-gnu --prefix=/home/ctng/x-tools/powerpc-unknown-linux-gnu --exec_prefix=/home/ctng/x-tools/powerpc-unknown-linux-gnu --with-sysroot=/home/ctng/x-tools/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu/sysroot --enable-languages=c,c++ --with-cpu=e500mc --with-pkgversion=crosstool-NG 1.24.0.548_0e1989a --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --disable-libmpx --disable-libstdcxx-verbose --with-gmp=/home/ctng/crosstool-ng/.build/powerpc-unknown-linux-gnu/buildtools --with-mpfr=/home/ctng/crosstool-ng/.build/powerpc-unknown-linux-gnu/buildtools --with-mpc=/home/ctng/crosstool-ng/.build/powerpc-unknown-linux-gnu/buildtools --with-isl=/home/ctng/crosstool-ng/.build/powerpc-unknown-linux-gnu/buildtools --enable-lto --enable-threads=posix --enable-target-optspace --enable-plugin --disable-nls --disable-multilib --with-local-prefix=/home/ctng/x-tools/powerpc-unknown-linux-gnu/powerpc-unknown-linux-gnu/sysroot --enable-long-long Invocation is $ powerpc-unknown-linux-gnu-gcc -mcpu=e500mc -O2 -c testcase.c -S -o testcase.S The original error occurred when building glibc. I've yet to produce a testcase that triggers gcc to emit the isel instruction but you can see the .machine directive doesn't match up with -mcpu or what gets passed to gas.
Created attachment 52511 [details] Attempt to trigger problem
Looks like a duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104090 *** This bug has been marked as a duplicate of bug 104090 ***