https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117500

            Bug ID: 117500
           Summary: [avr] Don't ICE on invalid inline asm operand
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

#include <avr/io.h>

void fn (void)
{
    __asm ("r0,%i0" :: "n" (20));
}

produces an ICE, and the location pointer is at the end of the function:

$ avr-gcc-15 foo.c -mmcu=atmega8
foo.c: In function 'fn':
foo.c:6:1: error: bad address, not an I/O address:
    6 | }
      | ^
(const_int 20 [0x14])
during RTL pass: final
foo.c:6:1: internal compiler error: in avr_print_operand, at
config/avr/avr.cc:3997

Better issue a proper error instead of fatal_insn().

Reply via email to