The memcpy optimizer was happily doing call slot forwarding when the new memory
authorDuncan Sands <baldrick@free.fr>
Thu, 4 Oct 2012 10:54:40 +0000 (10:54 +0000)
committerDuncan Sands <baldrick@free.fr>
Thu, 4 Oct 2012 10:54:40 +0000 (10:54 +0000)
commitf58747517cf2ba55c6f89a5ddc4de63be9e1362f
treef5634018597162bf785918eee8c539e8b3765a1e
parentaa3cb334af09ae30a3283f748cacb4a919785035
The memcpy optimizer was happily doing call slot forwarding when the new memory
was less aligned than the old.  In the testcase this results in an overaligned
memset: the memset alignment was correct for the original memory but is too much
for the new memory.  Fix this by either increasing the alignment of the new
memory or bailing out if that isn't possible.  Should fix the gcc-4.7 self-host
buildbot failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165220 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/MemCpyOptimizer.cpp
test/Transforms/MemCpyOpt/align.ll