[RS6000] PR 80938, Don't emit frame info for regs that don't need saving
It is possible when using out-of-line register saves or store multiple
to save some registers unnecessarily, for example one reg in the block
saved might be unused. We don't need to emit frame info for those
registers as that just bloats the info, and also can result in an ICE
when shrink-wrap gives multiple paths through the function saving
different sets of registers. Join points need to have identical frame
register save state regardless of the path taken.
This patch reverts the previous fix for PR80939 "Use SAVE_MULTIPLE
only if we restore what it saves (PR80938)" and instead fixes the PR
by correcting the frame info. The change to rs6000_savres_strategy
is an optimization, but note that it hides the underlying problem in
the PR testcase.
PR target/80938
* config/rs6000/rs6000.c (rs6000_savres_strategy): Revert 2017-08-09.
Don't use store multiple if only one reg needs saving.
(interesting_frame_related_regno): New function.
(rs6000_frame_related): Don't emit frame info for regs that
don't need saving.
(rs6000_emit_epilogue): Likewise.
From-SVN: r251140