https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91683

--- Comment #8 from Jim Wilson <wilson at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> Hmm, but shouldn't we instead fix combine to record not the reg rtx but the
> regno for UNDO_MODE?  Because nothing prevents this from happening elsewhere
> (even in combine itself?).

Changing do_SUBST_MODE to save the regno instead of the address of rhe reg rtx
is a possible solution, but can work only if there is no other place in combine
that might take the address of a reg rtx.  I can't be sure of that unless I do
more analysis, which I don't plan to do as I don't think this is the right
solution.

Also, I think I will get better code if I fix the splitters to use a clobber. 
As was mentioned in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91635#c19 ,
calling gen_reg_rtx means no REG_DEAD note which limits what combine can do,
whereas using a clobber means getting an existing reg that likely already has a
REG_DEAD note which helps combine.

Reply via email to