Fix pr41883 + 2 dups

Richard Henderson rth@redhat.com
Wed Jan 6 18:47:00 GMT 2010


The EPILOGUE_BEG note is used by the dwarf2 stuff to trigger saving and 
restoring the CFA state around an epilogue that appears in the middle of 
the function.  When the note is missing, the CFA state isn't saved and 
restored, which will then lead to a crash when a subsequent epilogue is 
encountered, as the CFA state doesn't match what's being unwound.

Normally, reposition_prologue_epilogue_notes searches the blocks with 
direct edges to EXIT, in order to fixup note misplacement caused by 
scheduling.  We do not search beyond the one basic block, because if 
there are multiple epilogues we could be moving the note from a 
different epilogue.  When I rewrote r_p_e_n for epilogue unwind, I 
expected that the scheduler would not move the note farther than the 
beginning of the block actually containing the epilogue.  That 
assumption was false for sched-ebb -- the epilogue note would get moved 
to the head of the ebb.

It turns out there was existing (but unused) support for not moving a 
note "too far".  This was for the old^3 eh implementation, and hadn't 
quite been removed.  Well, that's handy, I'll just reuse the bits I need 
to keep the EPILOGUE_BEG note near the (original) first epilogue insn, 
at which point r_p_e_n can fix things up if epilogue insns get moved around.

Tested on i386 and x86_64 linux.


r~
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: z
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100106/7355f1bc/attachment.ksh>


More information about the Gcc-patches mailing list