> As discussed in the PR and suggested by Uros, scheduler has code to keep a > use of hard register next to the assignment that sets that hard register > from a pseudo, which is desirable so that RA can deal with it properly. > Unfortunately, with -fstack-protector* we stick the stack protect epilogue > in between, which splits the load and use to different basic blocks. > The code emitted by expand_function_end between these two spots is only the > loading of the return value into registers, so generally it shouldn't > contain any stores which stack protection wants to guard against, so I > believe from security POV this shouldn't weaken anything, but fixes the > testcase.
This moves the stack protect epilogue from after the naked_return_label to before though, so it will be skipped for a naked return. -- Eric Botcazou