diff options
author | Dan Gohman <gohman@apple.com> | 2007-07-09 20:49:44 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-07-09 20:49:44 +0000 |
commit | 93f81e2822aa67337f629398c81bc2844ef9400a (patch) | |
tree | a88e30360d80793d134df0f5dceda49cfde89b16 /lib/CodeGen/SelectionDAG/TargetLowering.cpp | |
parent | da8ebc6b43cbc587bb072c7fbd9b6fed4baa7644 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38468 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/TargetLowering.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 44faf24b06..1b7b436b03 100644 --- a/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/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) { |