[PATCH] D54200: [PPC64] Use INT32_MIN instead of std::numeric_limits<int32_t>::min()

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 10:18:00 PST 2018


MaskRay updated this revision to Diff 172981.
MaskRay retitled this revision from "[PPC64] Use -0x80000000LL instead of std::numeric_limits<int32_t>::min()" to "[PPC64] Use INT32_MIN instead of std::numeric_limits<int32_t>::min()".
MaskRay edited the summary of this revision.
MaskRay added a comment.

Use INT32_MIN


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D54200

Files:
  ELF/Arch/PPC64.cpp


Index: ELF/Arch/PPC64.cpp
===================================================================
--- ELF/Arch/PPC64.cpp
+++ ELF/Arch/PPC64.cpp
@@ -847,8 +847,7 @@
   int32_t StackFrameSize = (HiImm * 65536) + LoImm;
   // Check that the adjusted size doesn't overflow what we can represent with 2
   // instructions.
-  if (StackFrameSize <
-      std::numeric_limits<int32_t>::min() + Config->SplitStackAdjustSize) {
+  if (StackFrameSize < Config->SplitStackAdjustSize + INT32_MIN) {
     error(getErrorLocation(Loc) + "split-stack prologue adjustment overflows");
     return false;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54200.172981.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181107/70ada234/attachment.bin>


More information about the llvm-commits mailing list