Skip to content
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

Can't compile core for msp430 - LLVM ERROR #45835

Open
japaric opened this issue Nov 7, 2017 · 2 comments
Open

Can't compile core for msp430 - LLVM ERROR #45835

japaric opened this issue Nov 7, 2017 · 2 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-target-specs Area: Compile-target specifications C-bug Category: This is a bug. O-msp430 requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-embedded Working group: Embedded systems

Comments

@japaric
Copy link
Member

japaric commented Nov 7, 2017

$ rustup default nightly-2017-11-04

$ rustup component add rust-src

$ cp -r $(rustc --print sysroot)/lib/rustlib/src/rust/src .

$ cd src/libcore

$ cargo build --target msp430-none-elf
   Compiling core v0.0.0 (file:///home/japaric/tmp/src/libcore)
LLVM ERROR: Cannot select: t3: ch = AtomicFence t0, Constant:i16<7>, Constant:i16<1>
  t1: i16 = Constant<7>
  t2: i16 = Constant<1>
In function: _ZN4core4sync6atomic5fence17h15543a17f4e17a82E
error: Could not compile `core`.

found while bisecting #45834

cc @pftbest

@japaric japaric added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Nov 7, 2017
@pftbest
Copy link
Contributor

pftbest commented Nov 7, 2017

msp430 doesn't have atomics, so not really LLVM's fault. Why does rust started emitting atomic instructions on msp?

@kennytm kennytm added the C-bug Category: This is a bug. label Nov 7, 2017
@japaric
Copy link
Member Author

japaric commented Nov 7, 2017

Why does rust started emitting atomic instructions on msp?

Traced it all the way down to somewhere between nightly-2017-10-09 and nightly-2017-10-10 but I don't have time to dig further.

Note that the LLVM error only appears when compiling core using the dev profile so this is not going to affect most users which will be compiling core in release mode (Xargo always compiles core in release mode) and that works ... or should work once #45836 is fixed.

@jonas-schievink jonas-schievink added A-target-specs Area: Compile-target specifications T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-embedded Working group: Embedded systems labels Jan 15, 2020
@jonas-schievink jonas-schievink added the requires-nightly This issue requires a nightly compiler in some way. label Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-target-specs Area: Compile-target specifications C-bug Category: This is a bug. O-msp430 requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-embedded Working group: Embedded systems
Projects
None yet
Development

No branches or pull requests

5 participants