Avoid fusing bitcasts with dynamic allocas if the amount-to-allocate
authorStuart Hastings <stuart@apple.com>
Mon, 13 Jun 2011 18:48:49 +0000 (18:48 +0000)
committerStuart Hastings <stuart@apple.com>
Mon, 13 Jun 2011 18:48:49 +0000 (18:48 +0000)
commit7ac8f8f3418c9ee7cb3f27aa9e5033e9b73ef84f
treef238f6dcf8994ca679135e870b4b23806fbd9afc
parentafa88eaf659a6151624fd11a61d038864339e8e4
Avoid fusing bitcasts with dynamic allocas if the amount-to-allocate
might overflow.  Re-typing the alloca to a larger type (e.g. double)
hoists a shift into the alloca, potentially exposing overflow in the
expression.  rdar://problem/9265821

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132926 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp
test/Transforms/InstCombine/2011-06-13-nsw-alloca.ll [new file with mode: 0644]