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

--- Comment #20 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Richard Biener from comment #18)
> I think ->sp_is_unchanging isn't the correct vehicle to test whether the red
> zone is usable - as you point out the red zone might be used/clobbered so the
> x86 backend would need to check for that, and a "memory" clobber should be
> enough to indicate this might happen (even if that pessimizes other code).

Please see Comment #16, x86 already checks sp_is_unchanging when redzone is
created in ix86_compute_frame_layout:

  if (ix86_using_red_zone ()
      && crtl->sp_is_unchanging
      && crtl->is_leaf
      && !ix86_pc_thunk_call_expanded
      && !ix86_current_function_calls_tls_descriptor)

Lookgin also at the proposed patch in PR117359, IMO having rsp in the output
list is what informs the compiler that %rsp is changing.

Reply via email to