https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104644
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #2) > Created attachment 52494 [details] > 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. Huh, it's odd that GENERIC would care for TREE_OVERFLOW when constant folding bswap .. where does it do that?