[PATCH] D45660: [RISCV] Fix assert message operator

Mandeep Singh Grang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 14 20:53:51 PDT 2018


mgrang created this revision.
mgrang added reviewers: asb, apazos.
Herald added subscribers: zzheng, shiva0217, kito-cheng, niosHD, sabuasal, jordy.potman.lists, simoncook, johnrusso, rbar.

Specifying assert message with an || operator makes the compiler interpret it
 as a bool. Changed it to &&.


Repository:
  rL LLVM

https://reviews.llvm.org/D45660

Files:
  lib/Target/RISCV/RISCVISelLowering.cpp


Index: lib/Target/RISCV/RISCVISelLowering.cpp
===================================================================
--- lib/Target/RISCV/RISCVISelLowering.cpp
+++ lib/Target/RISCV/RISCVISelLowering.cpp
@@ -658,7 +658,7 @@
 
   // Handle passing f64 on RV32D with a soft float ABI.
   if (XLen == 32 && ValVT == MVT::f64) {
-    assert(!ArgFlags.isSplit() && PendingLocs.empty() ||
+    assert(!ArgFlags.isSplit() && PendingLocs.empty() &&
            "Can't lower f64 if it is split");
     // Depending on available argument GPRS, f64 may be passed in a pair of
     // GPRs, split between a GPR and the stack, or passed completely on the


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45660.142535.patch
Type: text/x-patch
Size: 638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180415/6c3096dd/attachment.bin>


More information about the llvm-commits mailing list