[PATCH] Workaround MSVC 32-bit miscompile of getCondCodeAction

Daniel Sanders daniel.sanders at imgtec.com
Thu Oct 10 08:03:44 PDT 2013


  http://bb.pgr.jp/builders/ninja-clang-i686-msc17-R/builds/5000 is a build that fails with the in-tree targets. Specifically the MIPS and PowerPC targets trigger the MSVC bug in a total of three tests. I believe we can consider those tests in that builder to be the testcase. Do you agree?

  Assuming you do agree, then it will LGTM if that comment is updated to match the code.


================
Comment at: include/llvm/Target/TargetLowering.h:1418-1419
@@ -1419,4 +1417,4 @@
   /// large enough to fit all of the value types. This can be done by dividing
-  /// the MVT::LAST_VALUETYPE by 32 and adding one.
-  uint64_t CondCodeActions[ISD::SETCC_INVALID][(MVT::LAST_VALUETYPE / 32) + 1];
+  /// the MVT::LAST_VALUETYPE by 16 and adding one.
+  uint32_t CondCodeActions[ISD::SETCC_INVALID][(MVT::LAST_VALUETYPE + 15) / 16];
 
----------------
Comment needs updating to match the new round-up expression.

The array is slightly shorter than it used to be for some values of MVT::LAST_VALUETYPE but I believe it's correct.


http://llvm-reviews.chandlerc.com/D1568



More information about the llvm-commits mailing list