This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/87014] New: [x32] __builtin_eh_return should use 64-bit mov to set return address
- From: "theonetruecamper at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 19 Aug 2018 07:28:31 +0000
- Subject: [Bug target/87014] New: [x32] __builtin_eh_return should use 64-bit mov to set return address
- Auto-submitted: auto-generated
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
movl ptr(%rip), %eax
movl offset(%rip), %edx
movl %edx, %ecx
movl %eax, 8(%ebp,%ecx) # !
movq -16(%ebp), %rax
movq -8(%ebp), %rdx
leal 8(%rbp,%rcx), %ecx
movl 0(%ebp), %ebp
movl %ecx, %esp
ret # !!
Since the upper half of the return address is not cleared this can lead to
SIGSEGV in _Unwind_*