Skip to content

Aarch64 LLVM internal error "Both operands to a binary operator are not of the same type" #104099

@ogoffart

Description

@ogoffart

Our CI system building artifact for aarch64 started to fail with the release of Rust 1.65

I tried to reduce the bug a bit:

main.rs

fn main() {

    let mut fontdb = fontdb::Database::new();
    fontdb.load_system_fonts();
    fontdb.query(&fontdb::Query { families: &[fontdb::Family::Name("xxx")], ..Default::default() })
        .and_then(|face_id| {
            fontdb.with_face_data(face_id, |_face_data, _face_index| {
                fontdue::Font::from_bytes( b"sfqsqsfqd".as_slice(), fontdue::FontSettings::default())
            })
    });

    let  fonts = Vec::<fontdb::ID>::new();
    let face_id = fonts.into_iter().next().unwrap();
    fontdb .with_face_data(face_id, |_font_data, _face_index| {
        fontdue::Font::from_bytes(b"".as_slice(), fontdue::FontSettings::default())
    });
}

Cargo.toml dependencies

[dependencies]
fontdue = "0.7.2"
fontdb = "0.9.3"

[profile.release]
lto = true

Build with

cargo build --release --target aarch64-unknown-linux-gnu

(same with --target aarch64-apple-darwin)

Since Rust 1.65, we get this error:

Both operands to a binary operator are not of the same type!
  %2414 = xor i64 %2413, i32 4
in function _ZN7fontdue4font4Font10from_bytes17h0d1adf483f24d13bE
LLVM ERROR: Broken function found, compilation aborted!

Can still be reproduced in nightly

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions