This bug exists both in 14.2.1 20240921 and 15.0.0 20241006. The source code (simplified): static __attribute__ ((used,target("general-regs-only"),interrupt("IRQ"))) void irqa (void) {} static __attribute__ ((used,interrupt("IRQ"))) void irqb (void) {} static __attribute__ ((used,interrupt("IRQ"))) void irqc (void) {} static void irqd [[gnu::used,gnu::interrupt("IRQ"),gnu::target("general-regs-only")]] (void) {} The command line: arm-none-eabi-gcc -std=gnu23 -g -O2 -Wall -Werror -Wextra -Wpedantic -Wshadow -pipe -mcpu=cortex-a5 -mfpu=vfpv4-d16 -mfloat-abi=hard -o t.o -c t.c t.c:1:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only' [-Werror=attributes] 1 | static __attribute__ ((used,target("general-regs-only"),interrupt("IRQ"))) void irqa (void) {} | ^~~~~~ t.c:3:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only' [-Werror=attributes] 3 | static __attribute__ ((used,interrupt("IRQ"))) void irqc (void) {} | ^~~~~~ t.c:4:1: error: FP registers might be clobbered despite 'interrupt' attribute: compile with '-mgeneral-regs-only' [-Werror=attributes] 4 | static void irqd [[gnu::used,gnu::interrupt("IRQ"),gnu::target("general-regs-only")]] (void) {} | ^~~~~~ cc1: all warnings being treated as errors The error is only reported on the first and third function, although the first should be correct and the second and third should report the error. It is as though the target attribute is applied to the wrong (second) function, or processing of checks for the interrupt() attribute checks the wrong state. This happens for both C23 and classic attribute syntax. Ordering of the target and interrupt attributes seems to not matter.
This bug is related to 115263 which mentions the wrong documentation of the general-regs-only attribute, but does not give any example for reproduction.