[llvm-commits] [llvm] r38468 - /llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Dan Gohman djg at cray.com
Mon Jul 9 13:49:45 PDT 2007


Author: djg
Date: Mon Jul  9 15:49:44 2007
New Revision: 38468

URL: http://llvm.org/viewvc/llvm-project?rev=38468&view=rev
Log:
Initialize the IndexedModeActions array with memset before
updating it with calls to setIndexedLoadAction/setIndexedStoreAction,
which only update a few bits at a time. This avoids ostensible
undefined behavior of operationg on values which may be
trap-representations, and as a practical matter fixes errors from
valgrind, which doesn't track uninitialized memory with bit
granularity.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp?rev=38468&r1=38467&r2=38468&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/TargetLowering.cpp Mon Jul  9 15:49:44 2007
@@ -128,7 +128,9 @@
   memset(OpActions, 0, sizeof(OpActions));
   memset(LoadXActions, 0, sizeof(LoadXActions));
   memset(&StoreXActions, 0, sizeof(StoreXActions));
-  // Initialize all indexed load / store to expand.
+  memset(&IndexedModeActions, 0, sizeof(IndexedModeActions));
+
+  // Set all indexed load / store to expand.
   for (unsigned VT = 0; VT != (unsigned)MVT::LAST_VALUETYPE; ++VT) {
     for (unsigned IM = (unsigned)ISD::PRE_INC;
          IM != (unsigned)ISD::LAST_INDEXED_MODE; ++IM) {





More information about the llvm-commits mailing list