https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78103
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 51211 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51211&action=edit gcc12-pr78103.patch Updated untested patch that uses define_insn_and_split in 2 cases instead of the combine splitters so that it can work around the lack of LOG_LINKS. The patch doesn't do anything with -mlzcnt, even when bsr or bsr + lea would be shorter than mov + lzcnt + sub, but I'm afraid we can't do anything about that, we've lost information whether it is UB on zero or not with -mlzcnt and for zero input all this is quite unsafe.