about summary refs log tree commit diff
path: root/src/rustllvm/ExecutionEngineWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-12-21 00:03:59 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-12-21 09:26:41 -0800
commit2af8155bee8614a4e3bd1831f8927652c7475cc5 (patch)
tree2301b36dbd546cac3e36710e18a1d40053f634cd /src/rustllvm/ExecutionEngineWrapper.cpp
parent25f8051f2ebdc9444e0f75e91dc0cbb45d194181 (diff)
parent5722410f72d0698f6ad9ba668e2282ff0bac5043 (diff)
downloadrust-2af8155bee8614a4e3bd1831f8927652c7475cc5.tar.gz
rust-2af8155bee8614a4e3bd1831f8927652c7475cc5.zip
rollup merge of #19898: Aatch/issue-19684
#16081 fixed an issue where a nested return statement would cause incorrect behaviour due to the inner return writing over the return stack slot that had already been written too. However, the check was very broad and picked many cases that wouldn't ever be affected by this issue.

As a result, the number of allocas increased dramatically and therefore stack-size increased. LLVM is not able to remove all of the extraneous allocas. Any code that had multiple return values in a compound expression at the end of a function (including loops) would be hit by the issue.

The check now uses a control-flow graph to only consider the case when the inner return is executed conditionally. By itself, this narrowed definition causes #15763 to return, so the control-flow graph is also used to avoid passing the return slot as a destination when the result won't be used.

This change allows the stack-size of the main rustc task to be reduced to 8MB from 32MB.
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions