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

Never inline naked functions #79192

Merged
merged 1 commit into from
Nov 20, 2020
Merged

Never inline naked functions #79192

merged 1 commit into from
Nov 20, 2020

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Nov 19, 2020

The #[naked] attribute disabled prologue / epilogue emission for the
function and it is responsibility of a developer to provide them. The
compiler is no position to inline such functions correctly.

Disable inlining of naked functions at LLVM and MIR level.

Closes #60919.

@rust-highfive
Copy link
Collaborator

r? @oli-obk

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 19, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Nov 19, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Nov 19, 2020

📌 Commit 8afa22d has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 19, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
Never inline naked functions

The `#[naked]` attribute disabled prologue / epilogue emission for the
function and it is responsibility of a developer to provide them. The
compiler is no position to inline such functions correctly.

Disable inlining of naked functions at LLVM and MIR level.

Closes rust-lang#60919.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Nov 19, 2020
Never inline naked functions

The `#[naked]` attribute disabled prologue / epilogue emission for the
function and it is responsibility of a developer to provide them. The
compiler is no position to inline such functions correctly.

Disable inlining of naked functions at LLVM and MIR level.

Closes rust-lang#60919.
@Dylan-DPC-zz
Copy link

fails on wasm32 since asm! isn't supported:
https://github.com/rust-lang-ci/rust/runs/1426857118

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 19, 2020
The `#[naked]` attribute disabled prologue / epilogue emission for the
function and it is responsibility of a developer to provide them. The
compiler is no position to inline such functions correctly.

Disable inlining of naked functions at LLVM and MIR level.
@tmiasko
Copy link
Contributor Author

tmiasko commented Nov 20, 2020

Ignored test on wasm32.

@Dylan-DPC-zz
Copy link

@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Nov 20, 2020

📌 Commit c2fb999 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 20, 2020
@bors
Copy link
Contributor

bors commented Nov 20, 2020

⌛ Testing commit c2fb999 with merge 5c45969...

@bors
Copy link
Contributor

bors commented Nov 20, 2020

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing 5c45969 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 20, 2020
@bors bors merged commit 5c45969 into rust-lang:master Nov 20, 2020
@rustbot rustbot added this to the 1.50.0 milestone Nov 20, 2020
@tmiasko tmiasko deleted the naked-noinline branch November 20, 2020 12:41
yvt added a commit to r3-os/r3 that referenced this pull request Dec 6, 2020
Functions with `#[naked]` are no longer eligible for inlining as of
<rust-lang/rust#79192>.

Fixes test failures in the RISC-V port.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should #[naked] functions default to #[inline(never)] ?
6 participants