[PATCH] D44234: [AArch64] Fix UB about shift amount exceeds data bit-width

Weiming Zhao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 7 16:30:55 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL326969: [AArch64] Fix UB about shift amount exceeds data bit-width (authored by weimingz, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D44234?vs=137504&id=137509#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D44234

Files:
  llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp


Index: llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
===================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
+++ llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp
@@ -1512,7 +1512,7 @@
 
   // Because of simplify-demanded-bits in DAGCombine, the mask may have been
   // simplified. Try to undo that
-  AndImm |= (1 << NumberOfIgnoredLowBits) - 1;
+  AndImm |= maskTrailingOnes<uint64_t>(NumberOfIgnoredLowBits);
 
   // The immediate is a mask of the low bits iff imm & (imm+1) == 0
   if (AndImm & (AndImm + 1))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44234.137509.patch
Type: text/x-patch
Size: 596 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180308/70c19113/attachment.bin>


More information about the llvm-commits mailing list