diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc index 3cacf738c4ae2f9211b9ea00571a823294847474..22f444be23c8d3a35f0bbe5d80fbb953ffe4116a 100644 --- a/gcc/config/i386/i386.cc +++ b/gcc/config/i386/i386.cc @@ -6876,7 +6876,9 @@ ix86_compute_frame_layout (void) stack clash protections are enabled and the allocated frame is larger than the probe interval, then use pushes to save callee saved registers. */ - || (flag_stack_clash_protection && to_allocate > get_probe_interval ())) + || (flag_stack_clash_protection + && !ix86_target_stack_probe () + && to_allocate > get_probe_interval ())) frame->save_regs_using_mov = false; if (ix86_using_red_zone () @@ -8761,8 +8763,11 @@ ix86_expand_prologue (void) sse_registers_saved = true; } - /* If stack clash protection is requested, then probe the stack. */ - if (allocate >= 0 && flag_stack_clash_protection) + /* If stack clash protection is requested, then probe the stack, unless it + is already probed on the target. */ + if (allocate >= 0 + && flag_stack_clash_protection + && !ix86_target_stack_probe ()) { ix86_adjust_stack_and_probe (allocate, int_registers_saved, false); allocate = 0;