On 09/08/2016 07:20 PM, Jeff Law wrote:
On 08/29/2016 03:31 AM, Bernd Schmidt wrote:
How do these actually know where to save/restore registers? The frame
pointer may have been eliminated, and SP isn't necessarily constant
during the function. Seems like you'd have to calculate CFA reg/offset
much like dwarf2out does and pass it to this hook.
So I think the confusion here is these hooks are independent of
placement. ie, the target independent code does something like:
FOR_EACH_BB
Build the component bitmap using the incoming edge components
Emit the prologue components at the start of the block
Emit the epilogue components at the end of the block
The components handled by a particular block start are set/cleared by
the other hooks.
Hmm? The problem is that you can't generally emit a save/restore
independent of placement, because you may not know which offset to use
from whichever base register. But these offsets aren't necessarily
constant throughout the function. Segher explained that the algorithm
deals with this by giving up in many cases, which of course limits the
usefulness. It probably makes it unusable entirely on targets that want
to use pushes for function args.
Bernd