https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127921

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That said, because the code is already there, let's fix that just in case it
ever appears in the IL.
I wouldn't add a -fgimple testcase for this though.
2026-10-16  Jakub Jelinek  <[email protected]>

        PR middle-end/127921
        * gimple-lower-bitint.cc (gimple_lower_bitint) <case LROTATE_EXPR>:
        Fix up cast to utype if rhs1 is not INTEGER_CST.

--- a/gcc/gimple-lower-bitint.cc        2026-10-16 14:16:13.874329346 +0200
+++ b/gcc/gimple-lower-bitint.cc        2026-10-16 14:42:01.324646214 +0200
@@ -7490,10 +7490,11 @@ gimple_lower_bitint (void)
                        rhs1 = fold_convert (utype, rhs1);
                      else
                        {
-                         tree t = make_ssa_name (type);
+                         tree t = make_ssa_name (utype);
                          g = gimple_build_assign (t, NOP_EXPR, rhs1);
                          gsi_insert_before (&gsi, g, GSI_SAME_STMT);
                          gimple_set_location (g, loc);
+                         rhs1 = t;
                        }
                    }
                  g = gimple_build_assign (make_ssa_name (TREE_TYPE (rhs1)),

Reply via email to