Skip to content

Benchmark hang with lto = true and target-cpu=native #5312

@TheIronBorn

Description

@TheIronBorn

I'm benchmarking some code and often get hangs with $ RUSTFLAGS='-C target-cpu=native' cargo bench.

My Cargo.toml:

[profile.bench]
lto = true

It only happens when both LTO and target-cpu=native are enabled.

A typical output looks like this, where it hangs for as long as I've left it:

$ RUSTFLAGS='-C target-cpu=native' cargo bench
    Finished release [optimized] target(s) in 0.0 secs
     Running target/release/deps/bench-88a75a65bb7327e4

I'm using cargo 1.26.0-nightly (b70ab13b3 2018-04-04), and rustc 1.27.0-nightly (eeea94c11 2018-04-06). The code requires nightly so I can't test whether this happens on stable.
$ rustc --print target-cpus says my processor is sandybridge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions