[clang] [clang][Interp] Implement __builtin_popcountg (PR #84500)

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 8 07:29:17 PST 2024


================
@@ -53,11 +53,7 @@ static APSInt peekToAPSInt(InterpStack &Stk, PrimType T, size_t Offset = 0) {
     Offset = align(primSize(T));
 
   APSInt R;
-  INT_TYPE_SWITCH(T, {
-    T Val = Stk.peek<T>(Offset);
-    R = APSInt(APInt(Val.bitWidth(), static_cast<uint64_t>(Val), T::isSigned()),
----------------
overmighty wrote:

The previous code would truncate `IntegerAP`s wider than 64 bits.

https://github.com/llvm/llvm-project/pull/84500


More information about the cfe-commits mailing list