Internal testing within Red Hat tripped an assert in the x86 target.
The assert wants to verify that the integer registers were saved prior
to probing to deal with a special case where the probe turns into a call
(which occurs on Windows IIUC).
In the case of stack-clash we aren't bound by that restriction, so
asserting that the registers were saved doesn't make any real sense.
This patch avoids the assert in that situation.
Sadly, I can't recall the test which triggered this. It's almost
certainly something found when doing some testing with stack clash
protections enabled by default.
Bootstrapped and regression tested on x86.
OK for the trunk?
Jeff
* config/i386/i386.c (ix86_expand_prologue): Tighten assert
for int_registers_saved.
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 2967872..ea29ef3 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -13168,7 +13168,8 @@ ix86_expand_prologue (void)
|| flag_stack_clash_protection))
{
/* We expect the GP registers to be saved when probes are used. */
- gcc_assert (int_registers_saved);
+ if (!flag_stack_clash_protection)
+ gcc_assert (int_registers_saved);
if (flag_stack_clash_protection)
{