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

--- Comment #17 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #16)
> Created attachment 51209 [details]
> gcc12-pr78103.patch
> 
> Updated patch.  This one fixes the reuse of a pseudo you've mentioned above,
> and fixes gcc.target/i386/pr101175.c regression the patch reintroduced by
> adding !TARGET_LZCNT conditions to the two new define_insns.

Great :-)

> Nothing changes for combine though, I think it really would be nice if it
> could either change newly added pseudos from combine_split_insns by i2dest
> if possible,

Is that ever safe to do?

> or better handle new pseudos from both combine_split_insns and
> when
> for find_split_point i2dest can't be resued with creating LOG_LINKS.

You cannot safely attempt to combine the two insns split to again, neither
alone nor in combination with other insns.  Since pretty much by definition
that new reg will be set in the new i2 and used in (only) in the new i3,
no combination with that new reg is valid ever?

> I guess I can work around this by using define_insn_and_split instead of a
> combiner splitter, but combine splitters are cleaner...

Sometimes it helps to pretend you have an instruction you do not.  Both pure
splitters and define_insn_and_split have their place :-)

Reply via email to