https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103925
Bug ID: 103925
Summary: Missing int3 in ix86_output_indirect_function_return
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: andrew.cooper3 at citrix dot com, ubizjak at gmail dot com
Target Milestone: ---
[hjl@gnu-tgl-2 tmp]$ cat foo.c
struct _Unwind_Context _Unwind_Resume_or_Rethrow_this_context;
void offset (int);
struct _Unwind_Context {
void *reg[7];
} _Unwind_Resume_or_Rethrow() {
struct _Unwind_Context cur_contextcur_context =
_Unwind_Resume_or_Rethrow_this_context;
offset(0);
__builtin_eh_return ((long) offset, 0);
}
[hjl@gnu-tgl-2 tmp]$ /usr/gcc-12.0.0-x32/bin/gcc -S -O2 -fcf-protection
-mharden-sls=all foo.c
[hjl@gnu-tgl-2 tmp]$ cat foo.s
.file "foo.c"
.text
.p2align 4
.globl _Unwind_Resume_or_Rethrow
.type _Unwind_Resume_or_Rethrow, @function
_Unwind_Resume_or_Rethrow:
.LFB0:
.cfi_startproc
endbr64
pushq %rdx
.cfi_def_cfa_offset 16
.cfi_offset 1, -16
xorl %edi, %edi
pushq %rax
.cfi_def_cfa_offset 24
.cfi_offset 0, -24
subq $8, %rsp
.cfi_def_cfa_offset 32
call offset
movl $offset, %ecx
movq $0, 24(%rsp,%rcx)
movq 8(%rsp), %rax
movq 16(%rsp), %rdx
leaq 24(%rsp,%rcx), %rsp
.cfi_def_cfa_offset 8
popq %rcx
.cfi_register 16, 2
.cfi_def_cfa_offset 0
jmp *%rcx <<<< Missing int3
.cfi_endproc
.LFE0:
.size _Unwind_Resume_or_Rethrow, .-_Unwind_Resume_or_Rethrow
.globl _Unwind_Resume_or_Rethrow_this_context
.bss
.align 32
.type _Unwind_Resume_or_Rethrow_this_context, @object
.size _Unwind_Resume_or_Rethrow_this_context, 56
_Unwind_Resume_or_Rethrow_this_context:
.zero 56
.ident "GCC: (GNU) 12.0.0 20211225 (experimental)"
.section .note.GNU-stack,"",@progbits
.section .note.gnu.property,"a"
.align 8
.long 1f - 0f
.long 4f - 1f
.long 5
0:
.string "GNU"
1:
.align 8
.long 0xc0000002
.long 3f - 2f
2:
.long 0x3
3:
.align 8
4:
[hjl@gnu-tgl-2 tmp]$