Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 6, 2017

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Apr 2, 2017

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.

Fixes rust-lang#40493.
Fixes rust-lang#40573.
@arielb1 arielb1 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Apr 2, 2017
@arielb1 arielb1 mentioned this pull request Apr 2, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 3, 2017
@alexcrichton alexcrichton 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
Member

@bors: r+

(already landed on beta anyway)

@bors
Copy link
Contributor

bors commented Apr 4, 2017

📌 Commit 09ac56d has been approved by alexcrichton

@nikomatsakis
Copy link
Contributor

Nice job @arielb1 !

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.

Fixes rust-lang#40493.
Fixes rust-lang#40573.

r? @eddyb
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:master Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants