[Bug target/87014] [x32] __builtin_eh_return should use 64-bit mov to set return address
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87014 --- Comment #5 from camper --- test case (-O0): using ll = long long; void fillstack() { ll foo[] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, }; } void f(ll=-1,ll=-1,ll=-1,ll=-1,ll=-1,ll=-1,ll arg7_on_stack=-1) { throw 0; } void g() { try { f(); } catch(int) { } } int main() { fillstack(); g(); }
[Bug target/87014] [x32] __builtin_eh_return should use 64-bit mov to set return address
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87014 --- Comment #1 from camper --- Created attachment 44557 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44557&action=edit [x32] use 64-bit mov to set return address in eh_return compiles to: movlhandler(%rip), %eax movloffset(%rip), %edx movl%edx, %ecx movl%eax, %eax movq%rax, 8(%ebp,%ecx) movq-16(%ebp), %rax movq-8(%ebp), %rdx leal8(%rbp,%rcx), %ecx movl0(%ebp), %ebp movl%ecx, %esp ret
[Bug target/87014] New: [x32] __builtin_eh_return should use 64-bit mov to set return address
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87014 Bug ID: 87014 Summary: [x32] __builtin_eh_return should use 64-bit mov to set return address Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: theonetruecamper at gmx dot de Target Milestone: --- long offset; void* ptr; void f(void) { __builtin_eh_return(offset,ptr); } with gcc -mx32 produces (gcc (Gentoo Hardened 7.3.0-r3 p1.4) 7.3.0) f: pushq %rbp movl%esp, %ebp pushq %rdx pushq %rax movl%fs:24, %eax movl%eax, -20(%ebp) xorl%eax, %eax movlptr(%rip), %eax movloffset(%rip), %edx movl%edx, %ecx movl%eax, 8(%ebp,%ecx)# ! movq-16(%ebp), %rax movq-8(%ebp), %rdx leal8(%rbp,%rcx), %ecx movl0(%ebp), %ebp movl%ecx, %esp ret # !! Since the upper half of the return address is not cleared this can lead to SIGSEGV in _Unwind_*