https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117927
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- So --- gcc/match.pd.jj 2024-12-05 18:29:46.246399098 +0100 +++ gcc/match.pd 2024-12-06 09:38:35.670473040 +0100 @@ -4981,7 +4981,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) orotate (rrotate lrotate) (simplify (rotate @0 (minus INTEGER_CST@1 @2)) - (if (element_precision (TREE_TYPE (@0)) == wi::to_wide (@1)) + (if (element_precision (TREE_TYPE (@0)) == wi::to_wide (@1) + && tree_expr_nonzero_p (@2)) (orotate @0 @2)))) /* Turn (a OP c1) OP c2 into a OP (c1+c2). */ plus adjust the testcase? And I think we want to extend the r15-5635, r15-5657, r15-5731 changes to rotates as well.