Skip to content

Intrinsic has incorrect return type. LLVM ERROR: Broken function found, compilation aborted. aarch64 / ARM / nightly #118124

Closed

Description

@spital

Crate bytecount compilation fails with latest nightly on NanoPC-T6 (RK3588 ARM / aarch64).
It worked yesterday.

I tried this code:

cargo new bytecount_test && cd bytecount_test

cargo add bytecount
Updating crates.io index
  Adding bytecount v0.6.7 to dependencies.
         Features:
         - generic-simd
         - html_report
         - packed_simd
         - runtime-dispatch-simd
Updating crates.io index
cargo  +nightly-2023-11-20 build

Compiling bytecount v0.6.7
Intrinsic has incorrect return type!
ptr @llvm.aarch64.neon.ld1x4.v16i8.p0i8
in function _ZN4core9core_arch10arm_shared4neon9generated11vld1q_u8_x417hd6e0965b4ff7ff22E
LLVM ERROR: Broken function found, compilation aborted!
error: could not compile bytecount (lib)

cargo  +nightly-2023-11-19 build

Compiling bytecount v0.6.7
Compiling bytecount_test v0.1.0 (/home/pi/bytecount_test)
Finished dev [unoptimized + debuginfo] target(s) in 0.90s

uname -a

Linux NanoPC-T6 5.10.160 #7 SMP Thu Jul 20 15:53:55 CST 2023 aarch64 aarch64 aarch64 GNU/Linux

cat /etc/os-release

PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

I expected to see this happen: Finished dev [unoptimized + debuginfo] target(s) in 1.32s

Instead, this happened: LLVM ERROR: Broken function found, compilation aborted!

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 21, 2023
  2. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    O-AArch64Armv8-A or later processors in AArch64 mode
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 21, 2023
  3. added
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    on Nov 21, 2023
  4. Noratrieb commented on Nov 21, 2023

    @Noratrieb
    Member

    searched nightlies: from nightly-2023-11-19 to nightly-2023-11-20
    regressed nightly: nightly-2023-11-20
    searched commit range: 4cb3bee...9a66e44
    regressed commit: d19980e

    bisected with cargo-bisect-rustc v0.6.5

    Host triple: aarch64-unknown-linux-gnu
    Reproduce with:

    cargo bisect-rustc --start 2023-11-19 --access github --end 2023-11-20 --regress error

    looks like something in that PR changed ABI behavior and now LLVM and rustc disagree. Don't know who's wrong. @RalfJung @davidtwco

  5. added and removed
    E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc
    on Nov 21, 2023
  6. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Nov 21, 2023
  7. RalfJung commented on Nov 21, 2023

    @RalfJung
    Member

    Hm, I don't know how that "unadjusted" ABI stuff works...

    pub unsafe fn vld1q_s8_x4(a: *const i8) -> int8x16x4_t {
        #[allow(improper_ctypes)]
        extern "unadjusted" {
            #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vld1x4.v16i8.p0i8")]
            #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.ld1x4.v16i8.p0i8")]
            fn vld1q_s8_x4_(a: *const i8) -> int8x16x4_t;
        }
    vld1q_s8_x4_(a)
    }
  8. RalfJung commented on Nov 21, 2023

    @RalfJung
    Member

    #118127 should fix this. I am not sure how to add a test.

  9. apiraino commented on Nov 23, 2023

    @apiraino
    Contributor

    WG-prioritization assigning priority (Zulip discussion).

    @rustbot label -I-prioritize +P-high

  10. added
    P-highHigh priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Nov 23, 2023
  11. added a commit that references this issue on Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.O-AArch64Armv8-A or later processors in AArch64 modeP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions