Skip to content

mark build::cfg::start_new_block as inline(never) - #41015

Merged
bors merged 1 commit into
rust-lang:masterfrom
arielb1:new-block-stack
Apr 6, 2017
Merged

mark build::cfg::start_new_block as inline(never)#41015
bors merged 1 commit into
rust-lang:masterfrom
arielb1:new-block-stack

Conversation

@arielb1

Copy link
Copy Markdown
Contributor

LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some
circumstances. The function start_new_block has allocas totalling 1216
bytes, and when LLVM inlines several copies of that function into
the recursive function expr::into, that function's stack space usage
goes into tens of kiBs, causing stack overflows.

Mark start_new_block as inline(never) to keep it from being inlined,
getting stack usage under control.

Fixes#40493.
Fixes#40573.

r? @eddyb

LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some
circumstances. The function `start_new_block` has allocas totalling 1216
bytes, and when LLVM inlines several copies of that function into
the recursive function `expr::into`, that function's stack space usage
goes into tens of kiBs, causing stack overflows.
Mark `start_new_block` as inline(never) to keep it from being inlined,
getting stack usage under control.
Fixesrust-lang#40493.
Fixesrust-lang#40573.
@arielb1arielb1 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 2, 2017
@arielb1arielb1 mentioned this pull request Apr 2, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 3, 2017
@alexcrichtonalexcrichton added beta-accepted Accepted for backporting to the compiler in the beta channel. and removed beta-nominated Nominated for backporting to the compiler in the beta channel. labels Apr 4, 2017
@alexcrichton

Copy link
Copy Markdown
Member

@bors: r+

(already landed on beta anyway)

@bors

bors commented Apr 4, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit 09ac56d has been approved by alexcrichton

@nikomatsakis

Copy link
Copy Markdown
Contributor

Nice job @arielb1 !

@arielb1arielb1 mentioned this pull request Apr 5, 2017
arielb1 pushed a commit to arielb1/rust that referenced this pull request Apr 5, 2017
…hton
mark build::cfg::start_new_block as inline(never)
LLVM has a bug - [PR32488](https://bugs.llvm.org//show_bug.cgi?id=32488) - where it fails to deduplicate allocas in some
circumstances. The function `start_new_block` has allocas totalling 1216
bytes, and when LLVM inlines several copies of that function into
the recursive function `expr::into`, that function's stack space usage
goes into tens of kiBs, causing stack overflows.
Mark `start_new_block` as inline(never) to keep it from being inlined,
getting stack usage under control.
Fixesrust-lang#40493.
Fixesrust-lang#40573.
r? @eddyb
@arielb1arielb1 mentioned this pull request Apr 5, 2017
bors added a commit that referenced this pull request Apr 6, 2017
Rollup of 12 pull requests
- Successful merges: #40479, #40561, #40709, #40815, #40909, #40927, #40943, #41015, #41028, #41052, #41054, #41065
- Failed merges:
@bors
bors merged commit 09ac56d into rust-lang:masterApr 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta-acceptedAccepted for backporting to the compiler in the beta channel.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@arielb1@alexcrichton@bors@nikomatsakis@eddyb