Skip to content

ICE: broken MIR in Item(WithOptConstParam...) — encountered Assign statement with incompatible types #75597

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
little-arhat opened this issue Aug 16, 2020 · 6 comments
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@little-arhat
Copy link

Seen in automatic travis build: https://travis-ci.org/github/copterust/proving-ground/builds/718201256.

(error is triggered by this line).

$ rustc --version

rustc 1.47.0-nightly (8e21bd063 2020-08-14)

$ rustup --version

rustup 1.22.1 (b01adbbc3 2020-07-08)

$ cargo --version

cargo 1.47.0-nightly (ab32ee88d 2020-08-10)


Error output

Compiling alt-stm32f30x-hal v0.24.0

     Running `rustc --crate-name alt_stm32f30x_hal --edition=2018 /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/alt-stm32f30x-hal-0.24.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=s -C panic=abort -Cembed-bitcode=no -C codegen-units=1 -C debuginfo=2 -C debug-assertions=on --cfg 'feature="default"' --cfg 'feature="device-selected"' --cfg 'feature="rt"' --cfg 'feature="stm32f303"' -C metadata=f1ce9b70b61ec746 -C extra-filename=-f1ce9b70b61ec746 --out-dir /home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps --target thumbv7em-none-eabihf -L dependency=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps -L dependency=/home/travis/build/copterust/proving-ground/target/debug/deps --extern bitrate=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libbitrate-f70c4bf2280a0908.rmeta --extern bobbin_bits=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libbobbin_bits-323e8db8258afea3.rmeta --extern cast=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libcast-65ce1edada04de5f.rmeta --extern cortex_m=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libcortex_m-b54da80a2428812b.rmeta --extern hal=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libembedded_hal-c3a9158d7cbfe6b5.rmeta --extern nb=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libnb-bc2b79b5f894c7f4.rmeta --extern stm32f3=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libstm32f3-032fe9becdb87096.rmeta --extern void=/home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/deps/libvoid-2579d08d7437c761.rmeta --cap-lints allow -C link-arg=-Tlink.x -L /home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/build/cortex-m-9396aca9416fc59e/out -L /home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/build/cortex-m-adda42040cb9fc18/out -L /home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/build/stm32f3-ca9fdda15b6dd6d4/out -L /home/travis/build/copterust/proving-ground/target/thumbv7em-none-eabihf/debug/build/cortex-m-rt-2e52a225fbf36dae/out`

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:502 ~ alt_stm32f30x_hal[6093]::rcc[0]::{{impl}}[4]::freeze[0]), const_param_did: None }) (end of phase Optimized) at bb66[4]:

encountered `Assign` statement with incompatible types:

left-hand side has type: u8

right-hand side has type: bool

   --> /home/travis/.cargo/registry/src/github.com-1ecc6299db9ec823/alt-stm32f30x-hal-0.24.0/src/rcc.rs:379:17

    |

379 |                 0b01

    |                 ^^^^

    |

    = note: delayed at src/librustc_mir/transform/validate.rs:140:36

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src/librustc_errors/lib.rs:366:17

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@little-arhat little-arhat added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 16, 2020
@jonas-schievink jonas-schievink added A-mir-opt Area: MIR optimizations E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 16, 2020
@LeSeulArtichaut
Copy link
Contributor

I can't reproduce this issue on latest nightly (7e6d6e5 2020-08-16), using the following commands:

git clone https://github.com/copterust/proving-ground.git
cd proving-ground
rustup override set nightly
rustup target add thumbv7em-none-eabihf
mkdir gcc
curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2\?revision\=bc2c96c0-14b5-4bb4-9f18-bceb4050fee7\?product\=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,7-2018-q2-update | tar --strip-components=1 -C gcc -xj
export PATH="$PATH:$PWD/gcc/bin"
make mem=128k nodevice
RUST_BACKTRACE=1 make mem=128k all

However, I can reproduce it on nightly-2020-08-14 with the same commands, so this issue appears to already be fixed. @little-arhat are you still encountering issues with the latest nightly?

@little-arhat
Copy link
Author

@LeSeulArtichaut indeed, this seems to be fixed already, thanks!

@LeSeulArtichaut LeSeulArtichaut removed the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Aug 17, 2020
@LeSeulArtichaut
Copy link
Contributor

Would this be worth finding a test to prevent future regressions? cc @wesleywiser

@wesleywiser
Copy link
Member

@LeSeulArtichaut Yeah, that seems like a great idea!

@LeSeulArtichaut LeSeulArtichaut added E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. and removed E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example labels Aug 17, 2020
@LeSeulArtichaut
Copy link
Contributor

The ICE desappears in nightly-2020-08-16, so the fix should be contained in 8e21bd0...9b88e0a.

@JohnTitor JohnTitor added the E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example label Aug 19, 2020
@JulianKnodt
Copy link
Contributor

Ah sorry I suspect this was fixed here by: #75537
And this might be a replica of other issues linked in that PR. I think there are other regression tests included in that PR, so I believe this should be resolved.

@tmiasko tmiasko closed this as completed Feb 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations C-bug Category: This is a bug. E-needs-mcve Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants