OSDN Git Service

Fix MergeConsecutiveStore for non-byte-sized memory accesses.
authorJames Y Knight <jyknight@google.com>
Sat, 9 May 2015 03:13:37 +0000 (03:13 +0000)
committerJames Y Knight <jyknight@google.com>
Sat, 9 May 2015 03:13:37 +0000 (03:13 +0000)
commit01d1787830cb3c3212cdbe7c019b92560f4607b1
treeb0c2b4821d24687755ab7ef57fd48b63eb3af9fb
parent7d66bd3e7f3ae8ad982eaf7fead8e0127642f8cc
Fix MergeConsecutiveStore for non-byte-sized memory accesses.

The bug showed up as a compile-time assertion failure:
  Assertion `NumBits >= MIN_INT_BITS && "bitwidth too small"' failed
when building msan tests on x86-64.

Prior to r236850, this bug was masked due to a bogus alignment check,
which also accidentally rejected non-byte-sized accesses. Afterwards,
an invalid ElementSizeBytes == 0 got further into the function, and
triggered the assertion failure.

It would probably be a good idea to allow it to handle merging stores
of unusual widths as well, but for now, to un-break it, I'm just
making the minimal fix.

Differential Revision: http://reviews.llvm.org/D9626

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236927 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/X86/merge-consecutive-stores-i1.ll [new file with mode: 0644]