Running the following command line echo -e "#include <avr/io.h>\nvoid main() { __asm__ (\".L%=: jmp .L%=\" :: ); }" | \ avr-gcc -x c -mmcu=attiny2313 -pipe -Os -o bugtest.elf - fails with the following, misleading error message: {standard input}:17: Error: illegal opcode asr for mcu avr25 The correct error message should be: {standard input}:17: Error: illegal opcode jmp for mcu avr25 The compiler version in question is avr-gcc-12.1.0: ~$ avr-gcc --version avr-gcc (GCC) 12.1.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The instruction "jmp" is indeed unsupported on avr25, such as ATtiny2313, for instance. I hit that bug trying to debug my code and spent hours figuring out where I could have used the "ASR" instruction ("Arithmetic Shift Right" on the AVR platform). Turned out I didn't and it's only by tediously narrowing down the instruction using dichotomy reduction across hundreds of lines that I finally isolated the JMP instruction, which I had completely forgotten I had used... Fixing this bug may save several hours of vain searches, IMHO.
Thanks for the report. This sounds like a bug in GCC itself. Could you report it on their Bugzilla at https://gcc.gnu.org/bugzilla and link it here? It would be worth trying 12.1.1_p20220730 too.
ping. Did you have a chance to report it upstream?