summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-07-09 20:49:44 +0000
committerDan Gohman <gohman@apple.com>2007-07-09 20:49:44 +0000
commit6decfbf1332dda75c05d49d241409bc95ae7cf0e (patch)
treeb72de0a43b1b7233bda1e27f3bd55c206a01726e /llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
parentaee901745de3effeb000f66714bad39abbebfcca (diff)
downloadbcm5719-llvm-6decfbf1332dda75c05d49d241409bc95ae7cf0e.tar.gz
bcm5719-llvm-6decfbf1332dda75c05d49d241409bc95ae7cf0e.zip
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. llvm-svn: 38468
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 44faf24b064..1b7b436b031 100644
--- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
@@ -128,7 +128,9 @@ TargetLowering::TargetLowering(TargetMachine &tm)
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) {
OpenPOWER on IntegriCloud