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

--- Comment #2 from jcmvbkbc at gcc dot gnu.org ---
The change that made xtensa backend go ICE looks completely unrelated, and
indeed, the issue is caused by the side effect of compute_frame_size() function
call hidden in the INITIAL_ELIMINATION_OFFSET macro. This call updates the
value of the xtensa_current_frame_size static variable, used in "return"
instruction predicate. Prior to the change the value of
xtensa_current_frame_size was set to 0 after the end of epilogue generation,
which enabled the "return" instruction for the CALL0 ABI, but after the change
the additional INITIAL_ELIMINATION_OFFSET calls make xtensa_current_frame_size
non-zero and "return" pattern unavailable.

Get rid of the global xtensa_current_frame_size and xtensa_callee_save_size
variables by moving them into the machine_function structure. Implement
predicate for the "return" pattern as a function. Don't communicate completion
of epilogue generation through zeroing of xtensa_current_frame_size, add
explicit epilogue_done variable to the machine_function structure. Don't update
stack frame layout after the completion of reload.

Reply via email to