[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 69734, which changed state. Bug 69734 Summary: no_caller_saved_registers attribute doesn't work with -mavx512f -g https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69734 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 69596, which changed state. Bug 69596 Summary: vzeroupper is generated in interrupt handler https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69596 What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 69575, which changed state. Bug 69575 Summary: [interrupt] The direction flag DF in the FLAGS register may be wrong in interrupt handler https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69575 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 68037, which changed state. Bug 68037 Summary: x86 interrupt attribute doesn't work with DRAP https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68037 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 67648, which changed state. Bug 67648 Summary: No need to save callee-saved registers in interrupt handler https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67648 What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 67841, which changed state. Bug 67841 Summary: error: unable to find a register to spill if all registers are callee-saved https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67841 What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 67850, which changed state. Bug 67850 Summary: Wrong call_used_regs used in aggregate_value_p https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67850 What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 67855, which changed state. Bug 67855 Summary: -g doesn't with x86 interrupt handler https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67855 What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 67698, which changed state. Bug 67698 Summary: internal compiler error: in maybe_record_trace_start, at dwarf2cfi.c:2297 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67698 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 67630, which changed state. Bug 67630 Summary: ymm and zmm register aren't preserved in interrupt handler https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67630 What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 Bug 67552 depends on bug 67634, which changed state. Bug 67634 Summary: Can't preserve bound register in interrupt handler https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67634 What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 --- Comment #7 from H.J. Lu --- I think we should place if (current_function_decl && ix86_is_interrupt_p ()) { for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) { if (!STACK_REGNO_P (i) && !MMX_REGNO_P (i)) { if (i == BP_REG || i == SP_REG) continue; if (i >= ARGP_REG && i <= FRAME_REG) continue; call_used_regs[i] = 0; fixed_regs[i] = 0; } } } at the beginning of ix86_conditional_register_usage.
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 H.J. Lu changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2015-09-14 Ever confirmed|0 |1 --- Comment #6 from H.J. Lu --- (In reply to Yulia Koval from comment #5) > Sorry, I don't understand why we shouldn't preserve the red zone. The > function "foo", executing before the interrupt was called, used its red > zone. If the interrupt does not adjust the stack pointer, who control that > "foo" function's red zone would not be overwritten? Please take a look at Exception- or Interrupt-Handler Procedures in Intel64 and IA-32 Architectures Software Developer’s Manual vol 3. There is no red zone on stack of interrupt handler, which is controlled by processor, independent of any calling conventions.
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 --- Comment #5 from Yulia Koval --- Sorry, I don't understand why we shouldn't preserve the red zone. The function "foo", executing before the interrupt was called, used its red zone. If the interrupt does not adjust the stack pointer, who control that "foo" function's red zone would not be overwritten?
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 --- Comment #4 from H.J. Lu --- MMX instructions should be disallowed in interrupt handler: [hjl@gnu-6 interrupt-1]$ cat m.i typedef short __v4hi __attribute__ ((__vector_size__ (8))); typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__)); extern __m64 y, x; void __attribute__((interrupt)) fn1 (void) { x = (__m64) __builtin_ia32_packsswb ((__v4hi) x, (__v4hi) y); } [hjl@gnu-6 interrupt-1]$ make m.s /export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -O2 -S -o m.s m.i [hjl@gnu-6 interrupt-1]$ cat m.s .file "m.i" .section.text.unlikely,"ax",@progbits .LCOLDB0: .text .LHOTB0: .p2align 4,,15 .globl fn1 .type fn1, @function fn1: .LFB0: .cfi_startproc movqx(%rip), %mm0 addq$-128, %rsp packsswby(%rip), %mm0 movq%mm0, x(%rip) ret .cfi_endproc .LFE0: .size fn1, .-fn1 .section.text.unlikely .LCOLDE0: .text .LHOTE0: .ident "GCC: (GNU) 5.2.1 20150911" .section.note.GNU-stack,"",@progbits [hjl@gnu-6 interrupt-1]$
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 --- Comment #3 from H.J. Lu --- X87 instructions should be disallowed in interrupt handler: [hjl@gnu-6 interrupt-1]$ cat f.i extern long double y, x; void __attribute__((interrupt)) fn1 (void) { x += y; } [hjl@gnu-6 interrupt-1]$ make f.s /export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -O2 -S -o f.s f.i [hjl@gnu-6 interrupt-1]$ cat f.s .file "f.i" .section.text.unlikely,"ax",@progbits .LCOLDB1: .text .LHOTB1: .p2align 4,,15 .globl fn1 .type fn1, @function fn1: .LFB0: .cfi_startproc fldty(%rip) addq$-128, %rsp fldtx(%rip) faddp %st, %st(1) fstpt x(%rip) ret .cfi_endproc .LFE0: .size fn1, .-fn1 .section.text.unlikely .LCOLDE1: .text .LHOTE1: .ident "GCC: (GNU) 5.2.1 20150911" .section.note.GNU-stack,"",@progbits [hjl@gnu-6 interrupt-1]$
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 --- Comment #2 from H.J. Lu --- Red zone isn't supported in interrupt handler: 'interrupt' Use this attribute to indicate that the specified void function without arguments is an interrupt handler. The compiler generates function entry and exit sequences suitable for use in an interrupt handler when this attribute is present. The 'IRET' instruction, instead of the 'RET' instruction, is used to return from interrupt handlers. All registers, except for the EFLAGS register which is restored by the 'IRET' instruction, are preserved by the compiler. The red zone isn't supported in an interrupt handler; that is an interrupt handler can't access stack beyond the current stack pointer. It is wrong to do - if (crtl->args.pops_args && crtl->args.size) + if (ix86_is_interrupt_p ()) +{ + if (ix86_using_red_zone ()) + emit_insn (gen_adddi3 ( + gen_rtx_REG (DImode, SP_REG), + gen_rtx_REG (DImode, SP_REG), + GEN_INT (128))); GCC should assume that red zone isn't used in interrupt handler.
[Bug other/67552] [meta] x86 interrupt attribute
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552 --- Comment #1 from H.J. Lu --- Created attachment 36324 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36324&action=edit A patch to remove railing whitespaces in interrupt-switch-abi.c