[PATCH 3/6] Allow jumps in epilogues

Bernd Schmidt bernds@codesourcery.com
Thu Mar 24 10:30:00 GMT 2011


On 03/23/2011 06:27 PM, Richard Henderson wrote:
> On 03/23/2011 10:22 AM, Bernd Schmidt wrote:
>> On 03/23/2011 06:19 PM, Richard Henderson wrote:
>>> 	body
>>> 	body
>>> 	restore r1	XXX
>>> 	restore r2	XXX
>>> 	jmp L2		XXX
>>>
>>> L1:	body		YYY
>>> 	body		YYY
>>> 	restore r2
>>>
>>> L2:	restore r3
>>> 	return
>>
>>> In general, with shrink-wrapping, we can have essentially arbitrary
>>> differences in unwind info between blocks that are sequential.
>>
>> I don't think this can actually happen with the current implementation.
>> There is only one prologue, and all epilogues (the normal one and the
>> sibcall epilogues) match it exactly. I don't believe we can generate
>> code as in the example above, both before and after my patch.
> 
> Um.. then what's this "allow jumps in epilogues" thing of which you speak?
> If there's a jump, then it goes somewhere, and branches over something.
> I see no constraints on what that something might be.
> 
> Could you give an example of a transformation that is allowed by this?

The idea was to be able to share a single return instruction between
epilogue/non-epilogue return paths, so that e.g. on i686 a conditional
return could be implemented as a conditional jump to a common return
insn. The allow-jumps patch then becomes necessary because bbro can move
the blocks around.

It does seem, however, that bbro can in fact cause problems for the
unwind information when the prologue is no longer in the first block.
Let me try to come up with a solution for that.


Bernd



More information about the Gcc-patches mailing list