Fix PR7328: when turning a tail recursion into a loop, need to preserve
authorDuncan Sands <baldrick@free.fr>
Sat, 26 Jun 2010 12:53:31 +0000 (12:53 +0000)
committerDuncan Sands <baldrick@free.fr>
Sat, 26 Jun 2010 12:53:31 +0000 (12:53 +0000)
commitd50e9e2566479301e687fc81e16dab7e3c2b50ea
treea7591ad25c85aba30c85d2f235391595dc4e4b53
parent7a1d92a2cbc20888260efa7d5ad987dc39fcb134
Fix PR7328: when turning a tail recursion into a loop, need to preserve
the returned value after the tail call if it differs from other return
values.  The optimal thing to do would be to introduce a phi node for
the return value, but for the moment just fix the miscompile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106947 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/TailRecursionElimination.cpp
test/Transforms/TailCallElim/2010-06-26-MultipleReturnValues.ll [new file with mode: 0644]