[PATCH, rfc] combine: Make code after a new trap unreachable (PR78432)
Jeff Law
law@redhat.com
Mon Nov 28 22:02:00 GMT 2016
On 11/28/2016 03:00 PM, David Malcolm wrote:
> On Mon, 2016-11-28 at 14:44 -0700, Jeff Law wrote:
>> On 11/23/2016 04:55 PM, Segher Boessenkool wrote:
>>> Combine can turn a conditional trap into an unconditional trap. If
>>> it
>>> does that it should make the code after it unreachable (an
>>> unconditional
>>> trap should be the last insn in its bb, and that bb has no
>>> successors).
>>>
>>> This patch seems to work. It is hard to be sure, this is very hard
>>> to
>>> trigger. Quite a few other passes look like they need something
>>> similar
>>> as well, but I don't see anything else handling it yet either.
>>>
>>> How does this look? Any better ideas?
>> It's probably a reasonable place to start as there's lots of
>> similarities to converting a conditional branch to an unconditional.
>> Like you I worry there may be other instances of this issue may be
>> lurking.
>>
>> The possibility of having a conditional trap in the IL turn into an
>> unconditional trap has always been there. As you note, it's somewhat
>> difficult to trigger since the SSA optimizers ought to
>> expose/optimize
>> this long before we get to RTL.
>
> Could the RTL frontend be of use here?
Maybe -- but only on targets where we have the right insns in the target
machine description.
jeff
More information about the Gcc-patches
mailing list