[PATCH] Fix PR66168: ICE due to incorrect invariant register info
Jeff Law
law@redhat.com
Wed May 27 15:36:00 GMT 2015
On 05/24/2015 07:26 PM, Thomas Preud'homme wrote:
>> From: Jeff Law [mailto:law@redhat.com]
>> Sent: Saturday, May 23, 2015 6:54 AM
>>>
>>> - if (!can_move_invariant_reg (loop, inv, reg))
>>> + if (!can_move_invariant_reg (loop, inv, dest))
>> Won't this run into into the same problem if DEST is a SUBREG?
>
> One of the very first test in can_move_invariant_reg is:
>
> if (!REG_P (reg) || !HARD_REGISTER_P (reg))
> return false;
>
> So in case of a subreg the insn will not be moved which will execute the same
> code as before my patch. It would be nicer if it could work with subreg of
> course but this makes for a much smaller and safer patch.
Ah, OK. I was looking at the code prior to the call for
can_move_invariant_reg in move_invariant_reg which implies that DEST can
be a subreg, but REG can not.
But with that check in can_move_invariant_reg obviously won't matter.
It feels like we've likely got some dead code here, but that can be a
follow-up if you want to pursue.
OK for the trunk.
Jeff
More information about the Gcc-patches
mailing list