summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprCXX.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-12-06 07:52:42 +0000
committerChris Lattner <sabre@nondot.org>2010-12-06 07:52:42 +0000
commitfb212de06ded3800d99fcf804c2ce8dbafe7dbf6 (patch)
treefd72c5da44cd5e85109916b444afd542c8f41bca /clang/lib/CodeGen/CGExprCXX.cpp
parentcd3af96a8f59d5dd8b0d8c5f590f111c81d3e075 (diff)
downloadbcm5719-llvm-fb212de06ded3800d99fcf804c2ce8dbafe7dbf6.tar.gz
bcm5719-llvm-fb212de06ded3800d99fcf804c2ce8dbafe7dbf6.zip
Fix PR8735, a really terrible problem in the inliner's "alloca merging"
optimization. Consider: static void foo() { A = alloca ... } static void bar() { B = alloca ... call foo(); } void main() { bar() } The inliner proceeds bottom up, but lets pretend it decides not to inline foo into bar. When it gets to main, it inlines bar into main(), and says "hey, I just inlined an alloca "B" into main, lets remember that. Then it keeps going and finds that it now contains a call to foo. It decides to inline foo into main, and says "hey, foo has an alloca A, and I have an alloca B from another inlined call site, lets reuse it". The problem with this of course, is that the lifetime of A and B are nested, not disjoint. Unfortunately I can't create a reasonable testcase for this: the one in the PR is both huge and extremely sensitive, because you minor tweaks end up causing foo to get inlined into bar too early. We already have tests for the basic alloca merging optimization and this does not break them. llvm-svn: 120995
Diffstat (limited to 'clang/lib/CodeGen/CGExprCXX.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud