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

Generate code for unused const- and inline-fns if -Clink-dead-code is specified. #46916

Merged
merged 1 commit into from
Jan 4, 2018

Conversation

michaelwoerister
Copy link
Member

Fixes #46467.

r? @alexcrichton

@alexcrichton
Copy link
Member

@bors: r+

Nice!

@bors
Copy link
Contributor

bors commented Dec 21, 2017

📌 Commit f284ebb has been approved by alexcrichton

@arielb1 arielb1 added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 21, 2017
@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 21, 2017
@kennytm
Copy link
Member

kennytm commented Dec 21, 2017

@bors r-

The new test failed in the rollup.

// code for functions that would otherwise be skipped.

// CHECK-LABEL: define hidden i64 @_ZN14link_dead_code8const_fn
const fn const_fn() -> usize { 1 }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change the usize to some more portable type. This test is failing on 32-bit platforms.

[00:52:46] ---- [codegen] codegen/link-dead-code.rs stdout ----
[00:52:46] 	
[00:52:46] error: verification with 'FileCheck' failed
[00:52:46] status: exit code: 1
[00:52:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--input-file" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/link-dead-code.ll" "/checkout/src/test/codegen/link-dead-code.rs"
[00:52:46] stdout:
[00:52:46] ------------------------------------------
[00:52:46] 
[00:52:46] ------------------------------------------
[00:52:46] stderr:
[00:52:46] ------------------------------------------
[00:52:46] /checkout/src/test/codegen/link-dead-code.rs:19:17: error: expected string not found in input
[00:52:46] // CHECK-LABEL: define hidden i64 @_ZN14link_dead_code8const_fn
[00:52:46]                 ^
[00:52:46] /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/link-dead-code.ll:1:1: note: scanning from here
[00:52:46] ; ModuleID = 'link_dead_code0-8787f43e282added376259c1adb08b80.rs'
[00:52:46] ^
[00:52:46] /checkout/obj/build/x86_64-unknown-linux-gnu/test/codegen/link-dead-code.ll:8:1: note: possible intended match here
[00:52:46] define hidden i32 @_ZN14link_dead_code8const_fn17h307759a84b38b8b4E() unnamed_addr #0 {
[00:52:46] ^
[00:52:46] 
[00:52:46] ------------------------------------------
[00:52:46] 
[00:52:46] thread '[codegen] codegen/link-dead-code.rs' panicked at 'explicit panic', /checkout/src/tools/compiletest/src/runtest.rs:2776:8
[00:52:46] note: Run with `RUST_BACKTRACE=1` for a backtrace.

@kennytm kennytm 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 Dec 21, 2017
@pnkfelix
Copy link
Member

@michaelwoerister are you going to be able to address the problem pointed out by kennytm?

Times getting very tight to backport this into beta...

@michaelwoerister
Copy link
Member Author

Whoops, sorry, didn't see this because of PTO.

@michaelwoerister
Copy link
Member Author

@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Jan 4, 2018

📌 Commit 238ed47 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Jan 4, 2018

⌛ Testing commit 238ed47 with merge 8e7a609...

bors added a commit that referenced this pull request Jan 4, 2018
…xcrichton

Generate code for unused const- and inline-fns if -Clink-dead-code is specified.

Fixes #46467.

r? @alexcrichton
@bors
Copy link
Contributor

bors commented Jan 4, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing 8e7a609 to master...

@bors bors merged commit 238ed47 into rust-lang:master Jan 4, 2018
@nagisa nagisa added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 7, 2018
@alexcrichton alexcrichton added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Jan 10, 2018
@alexcrichton
Copy link
Member

Accepting for backport as it fixes a regression #46467

@MaloJaffre MaloJaffre mentioned this pull request Jan 10, 2018
bors added a commit that referenced this pull request Jan 10, 2018
[beta] Backports

Cherry-picked (cleanly) into beta:
- #46916
- #47161
- #47208
- #47269
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jan 11, 2018
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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants