https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78098
Bug ID: 78098 Summary: error: interrupt service routine can't be called directly Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: hjl.tools at gmail dot com Target Milestone: --- [hjl@gnu-6 repro]$ cat foo.c void bar (int); __attribute__((interrupt)) void foo1 (void *p) { bar (0); *((int *)0xFEE00080) = 0; } __attribute__((interrupt)) void foo2 (void *p) { bar (0); *((int *)0xFEE00080) = 0; } [hjl@gnu-6 repro]$ make foo.s /export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -Os -mno-sse -mno-mmx -mno-80387 -S -o foo.s foo.c foo.c: In function ‘foo1’: foo.c:3:33: error: interrupt service routine can't be called directly __attribute__((interrupt)) void foo1 (void *p) ^~~~ Makefile:21: recipe for target 'foo.s' failed make: *** [foo.s] Error 1 [hjl@gnu-6 repro]$ The problem is the tail call: ;; Function foo1 (foo1, funcdef_no=3, decl_uid=1466, cgraph_uid=0, symbol_order=0) foo1 (void * p) { ;; basic block 2, loop depth 0 ;; pred: ENTRY foo2 (p_2(D)); [tail call] return; ;; succ: EXIT }