[Bug target/95655] New: -mfentry -pg generates extra push/pop
hjl.tools at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Jun 12 11:59:42 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95655
Bug ID: 95655
Summary: -mfentry -pg generates extra push/pop
Product: gcc
Version: 10.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: target
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
CC: crazylht at gmail dot com
Target Milestone: ---
Target: i386
[hjl@gnu-cfl-2 tmp]$ cat y.i
void
f10_endbr (void)
{
}
[hjl@gnu-cfl-2 tmp]$ /usr/gcc-10.1.1-32bit/bin/gcc -O1 -mfentry -pg -S y.i
-m32 -march=x86-64
[hjl@gnu-cfl-2 tmp]$ cat y.s
.file "y.i"
.text
.globl f10_endbr
.type f10_endbr, @function
f10_endbr:
.LFB0:
.cfi_startproc
1: call __fentry__
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size f10_endbr, .-f10_endbr
.ident "GCC: (GNU) 10.1.1 20200523"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 tmp]$ /usr/gcc-10.1.1-x32/bin/gcc -O1 -mfentry -pg -S y.i -m32
-march=x86-64
[hjl@gnu-cfl-2 tmp]$ cat y.s
.file "y.i"
.text
.globl f10_endbr
.type f10_endbr, @function
f10_endbr:
.LFB0:
.cfi_startproc
1: call __fentry__
ret
.cfi_endproc
.LFE0:
.size f10_endbr, .-f10_endbr
.ident "GCC: (GNU) 10.1.1 20200523"
.section .note.GNU-stack,"",@progbits
[hjl@gnu-cfl-2 tmp]$
The extra
pushl %ebp
movl %esp, %ebp
popl %ebp
are only generated by the 32-bit GCC. 64-bit GCC is OK.
More information about the Gcc-bugs
mailing list