================
@@ -15774,7 +15768,53 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const 
CallExpr *E,
         !EvaluateInteger(E->getArg(1), Amt, Info))
       return false;
 
-    return Success(Val.rotr(Amt), E);
+    // Normalize shift amount to [0, BitWidth) range to match runtime behavior
+    unsigned BitWidth = Val.getBitWidth();
----------------
efriedma-quic wrote:

Please move the APInt code for performing the rotate into a helper shared by 
ExprConstant and InterpBuiltin.

https://github.com/llvm/llvm-project/pull/160259
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to