https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117492
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #3) > /* Two consecutive rotates adding up to the some integer > multiple of the precision of the type can be ignored. */ > if (code == RROTATE_EXPR && TREE_CODE (arg1) == INTEGER_CST > && TREE_CODE (arg0) == RROTATE_EXPR > && TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST > && wi::umod_trunc (wi::to_wide (arg1) > + wi::to_wide (TREE_OPERAND (arg0, 1)), > prec) == 0) > return fold_convert_loc (loc, type, TREE_OPERAND (arg0, 0)); > > This is all old code too. > > I suspect it should be using wi::to_widest instead. > > Let me try that. > > Plus I suspect this should be moved to match too. Actually there is already some code in match to handle this. This can just be removed.