Skip to content

Invalid monomorphization when -C link-dead-code is used #77529

Open
@xd009642

Description

@xd009642

I've tried to compile this crate https://github.com/yoanlcq/vek as part of running code coverage and with RUSTFLAGS="-C link-dead-code" and --features platform_intrinsics it fails to build. But without -C link-dead-code it builds and runs fine which is what I'd expect with the flag present.

Sample error (they're all the same error just different bits of code:

error[E0511]: invalid monomorphization of `simd_reduce_any` intrinsic: unsupported simd_reduce_any from `vec::repr_simd::extent2::Extent2<bool>` with element `bool` to `bool`
    --> src/vec.rs:1346:43
     |
1346 |                       simd_llvm => unsafe { simd_llvm::simd_reduce_any(self) },
     |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
3195 | /     vec_impl_all_vecs!{
3196 | |         simd
3197 | |         #[repr(simd)]
3198 | |     }
     | |_____- in this macro invocation
     |
     = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 14 previous errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Clink-dead-codeLinkage option: -Clink-dead-codeA-SIMDArea: SIMD (Single Instruction Multiple Data)A-diagnosticsArea: Messages for errors, warnings, and lintsA-intrinsicsArea: IntrinsicsD-confusingDiagnostics: Confusing error or lint that should be reworked.I-monomorphizationIssue: An error at monomorphization time.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions