https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87085
Bug ID: 87085
Summary: with -march=i386, gcc should not generate code
including endbr instruction
Product: gcc
Version: 8.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: chengming at bjuci dot com.cn
Target Milestone: ---
My gcc version is gcc (GCC) 8.2.1 20180801 (Red Hat 8.2.1-2), OS is Fedora 28.
I develop program for a CPU called Vortex86 on it. Vortex86 is an x86
artitecture CPU from Taiwan.
My problem is, even a program with only "return 0;", it will cause "Illegal
Instruction" on Vortex86.
Based on dumped core file and objdump, the problem comes from the endbr32
instruction.
Even though I add the -march=i386 and -fcf-protection=none option, it still
output endbr32 instruction.
So I think it's a bug. Because i386 CPU didn't support endbr32 instruction. If
I specified -march=i386, it should not generate endbr32 instruction.
There is no such problem on GCC 7 and below.
Thanks.