Skip to content

Internal llvm failure if using -O2 with thumbv7em-linux-eabi target #14870

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

Closed
farcaller opened this issue Jun 13, 2014 · 3 comments
Closed

Internal llvm failure if using -O2 with thumbv7em-linux-eabi target #14870

farcaller opened this issue Jun 13, 2014 · 3 comments

Comments

@farcaller
Copy link
Contributor

On cross-compiling libcore, if cpu is locked in to cortex-m4 and -O2 is used, llvm fails with unreachable:

rustc --target thumbv7em-linux-eabi -Ctarget-cpu=cortex-m4 --opt-level 2 libcore/lib.rs
Unexpected member type for HA
UNREACHABLE executed at /Users/farcaller/temp/rust/src/llvm/lib/Target/ARM/ARMCallingConv.h:213!

Compiling without --opt-level 2 or -Ctarget-cpu=cortex-m4 works as expected.

PS: I think this is an LLVM bug, but I cannot figure out a small test case.

@alexcrichton
Copy link
Member

This is the IR run through bugpoint: https://gist.github.com/ff0487dadc8576d07bdf.

This isn't very actionable on our end as this definitely looks like an LLVM bug, so I'm going to close this. I would recommend reporting the bugpoint output upstream after trying to minimize it further.

@farcaller
Copy link
Contributor Author

It seems that this one is actually fixed at r209650 of llvm. What's the rust policy to bump tracking llvm version?

@alexcrichton
Copy link
Member

If you make a pull request against rust-lang/llvm with the new commits, I can push so you can update the submodule.

flip1995 pushed a commit to flip1995/rust that referenced this issue May 31, 2025
…14870)

So, after rust-lang/rust-clippy#14693 was
merged,
this is the continuation. It performs some optimizations on
`Fragments::span`
, makes it so we don't call it so much, and makes a 85.75% decrease
(7.51% -> 1.07%)
in execution samples of `source_span_for_markdown_range` and a 6.39% ->
0.88%
for `core::StrSearcher::new`. Overall a 13.11% icount decrase on
docs-heavy crates.

Benchmarked mainly on `regex-1.10.5`.

@rustbot label +performance-project

This means that currently our heaviest function is
`rustc_middle::Interners::intern_ty`, even
for documentation-heavy crates

Along with rust-lang/rust-clippy#14693, this makes the lint a 7% of what
it was before and makes it so that even in the most doc-heavy of crates
it's not an issue.

changelog:Optimize documentation lints by a further 85%

r? @Jarcho
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants