-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Conversation
@bors: r+ Nice! |
📌 Commit f284ebb has been approved by |
@bors r- The new test failed in the rollup. |
src/test/codegen/link-dead-code.rs
Outdated
// code for functions that would otherwise be skipped. | ||
|
||
// CHECK-LABEL: define hidden i64 @_ZN14link_dead_code8const_fn | ||
const fn const_fn() -> usize { 1 } |
There was a problem hiding this comment.
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.
@michaelwoerister are you going to be able to address the problem pointed out by kennytm? Times getting very tight to backport this into beta... |
Whoops, sorry, didn't see this because of PTO. |
f284ebb
to
238ed47
Compare
@bors r=alexcrichton |
📌 Commit 238ed47 has been approved by |
…xcrichton Generate code for unused const- and inline-fns if -Clink-dead-code is specified. Fixes #46467. r? @alexcrichton
☀️ Test successful - status-appveyor, status-travis |
Accepting for backport as it fixes a regression #46467 |
Fixes #46467.
r? @alexcrichton