[Bug target/83641] -fstack-clash-protection generates incorrect CFI on i386

law at redhat dot com gcc-bugzilla@gcc.gnu.org
Tue Jan 2 15:47:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83641

--- Comment #3 from Jeffrey A. Law <law at redhat dot com> ---
So the issue here is when we have a noreturn function we use a push/pop
sequence to probe the top of the stack.

The generic dwarf2 CFI bits interpret the pop as restoring the value of the
popped register.  But that's not strictly correct if the register is also
callee-saved (which implies that it'll be set later by the body of the
function).

Of course the push/pop sequence is not needed in this case since the callee
register save acts as a probe.  This is a known, relatively minor,
inefficiency.

The good news is the bogus CFI issue is a strict subset of the performance
issue and thus if we fix the performance issue, the codegen issue gets resolved
at the same time.  I expect to have this fixed within the next couple hours.


More information about the Gcc-bugs mailing list