OSDN Git Service

Fix codegen to compute the size of an allocation by multiplying the
authorChris Lattner <sabre@nondot.org>
Tue, 17 Mar 2009 19:36:00 +0000 (19:36 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 17 Mar 2009 19:36:00 +0000 (19:36 +0000)
commit0b18e59336dcb18e036540dd667fed8d17c3cc09
tree5e6e5d3e783ba75a8e4fae7565ea30cc7655c2d1
parent46d232d4bc198ce4a347e74f331a99142a02276d
Fix codegen to compute the size of an allocation by multiplying the
size by the array amount as an i32 value instead of promoting from
i32 to i64 then doing the multiply.  Not doing this broke wrap-around
assumptions that the optimizers (validly) made.  The ultimate real
fix for this is to introduce i64 version of alloca and remove mallocinst.

This fixes PR3829

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67093 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
test/CodeGen/X86/x86-64-malloc.ll [new file with mode: 0644]