Internal llvm error: UNREACHABLE executed at ARMCallingConv.h:213

Initially this one got triggered from rustc, so I don’t have a simple test case for you, unfortunately.

IR after processing through bugpoint: https://gist.github.com/ff0487dadc8576d07bdf.

Symptoms:

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!

Compiles as expected if either -O2 or target-cpu is removed.

This looks very similar to the issue fixed[*] in r209650. Are you
running on trunk, or an older build of LLVM?

Cheers.

Tim.

[*] Well, we generate *some* code now. I believe there are still
issues around strict AAPCS-VFP conformance on Cortex-M4.