https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104644
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 #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 52494 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52494&action=edit gcc12-pr104644.patch Untested fix. The match.pd optimization relies on (bswap @1) actually being simplified into something other than bswap when @1 is INTEGER_CST, but that isn't guaranteed at least in GENERIC - due to TREE_OVERFLOW in there. The patch uses ! to enforce simplification of that and because ! isn't supported in GENERIC, also requires GIMPLE for the optimization.