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

ICE: Invalid float op Neg #124583

Closed
matthiaskrgr opened this issue May 1, 2024 · 2 comments · Fixed by #126429
Closed

ICE: Invalid float op Neg #124583

matthiaskrgr opened this issue May 1, 2024 · 2 comments · Fixed by #126429
Assignees
Labels
C-bug Category: This is a bug. F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented May 1, 2024

snippet:

fn main() {
    let _ = -(-0.0f16);
}

Version information

rustc 1.80.0-nightly (378a43a06 2024-05-01)
binary: rustc
commit-hash: 378a43a06510f3e3a49c69c8de71745e6a884048
commit-date: 2024-05-01
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.4

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

error[E0658]: the type `f16` is unstable
 --> /tmp/icemaker_global_tempdir.LUs0yTDS2O3R/rustc_testrunner_tmpdir_reporting.laee65vXPGyd/mvce.rs:2:16
  |
2 |     let _ = -(-0.0f16);
  |                ^^^^^^
  |
  = note: see issue #116909 <https://github.com/rust-lang/rust/issues/116909> for more information
  = help: add `#![feature(f16)]` to the crate attributes to enable
  = note: this compiler was built on 2024-05-01; consider upgrading it if it is out of date

error: internal compiler error: /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/compiler/rustc_const_eval/src/interpret/operator.rs:498:26: Invalid float op Neg
 --> /tmp/icemaker_global_tempdir.LUs0yTDS2O3R/rustc_testrunner_tmpdir_reporting.laee65vXPGyd/mvce.rs:1:1
  |
1 | fn main() {
  | ^^^^^^^^^

thread 'rustc' panicked at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/compiler/rustc_const_eval/src/interpret/operator.rs:498:26:
Box<dyn Any>
stack backtrace:
   0:     0x75fcab3ba035 - std::backtrace_rs::backtrace::libunwind::trace::hda47b82a166812ce
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/../../backtrace/src/backtrace/libunwind.rs:105:5
   1:     0x75fcab3ba035 - std::backtrace_rs::backtrace::trace_unsynchronized::hfdfc54f1e69a0c51
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x75fcab3ba035 - std::sys_common::backtrace::_print_fmt::h793b3f7571d13dfd
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x75fcab3ba035 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hbc9f1fbbb950dc64
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x75fcab40929b - core::fmt::rt::Argument::fmt::h616c7e5e48e69035
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/core/src/fmt/rt.rs:165:63
   5:     0x75fcab40929b - core::fmt::write::h273cb7cce9dfa202
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/core/src/fmt/mod.rs:1157:21
   6:     0x75fcab3aebdf - std::io::Write::write_fmt::h945d30311b10e894
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/io/mod.rs:1832:15
   7:     0x75fcab3b9e0e - std::sys_common::backtrace::_print::hcdebe37872d00154
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x75fcab3b9e0e - std::sys_common::backtrace::print::h51bd45a216cc9df6
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x75fcab3bc779 - std::panicking::default_hook::{{closure}}::hb6bc4eb0d96a4bfd
  10:     0x75fcab3bc4bd - std::panicking::default_hook::h557ff9f57d861b48
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/panicking.rs:298:9
  11:     0x75fca7c3c6bb - std[8fa947ca3cb89c52]::panicking::update_hook::<alloc[4c35cc17dd12f569]::boxed::Box<rustc_driver_impl[f52ddb602ce7d3c0]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x75fcab3bce76 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::hf5d9c19b8a775637
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/alloc/src/boxed.rs:2036:9
  13:     0x75fcab3bce76 - std::panicking::rust_panic_with_hook::h310a921a123719cf
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/panicking.rs:799:13
  14:     0x75fca7c6c084 - std[8fa947ca3cb89c52]::panicking::begin_panic::<rustc_errors[dbe3df606ebeeaa3]::ExplicitBug>::{closure#0}
  15:     0x75fca7c68d06 - std[8fa947ca3cb89c52]::sys_common::backtrace::__rust_end_short_backtrace::<std[8fa947ca3cb89c52]::panicking::begin_panic<rustc_errors[dbe3df606ebeeaa3]::ExplicitBug>::{closure#0}, !>
  16:     0x75fca7c689e6 - std[8fa947ca3cb89c52]::panicking::begin_panic::<rustc_errors[dbe3df606ebeeaa3]::ExplicitBug>
  17:     0x75fca7c75261 - <rustc_errors[dbe3df606ebeeaa3]::diagnostic::BugAbort as rustc_errors[dbe3df606ebeeaa3]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
  18:     0x75fca822e208 - <rustc_errors[dbe3df606ebeeaa3]::DiagCtxt>::span_bug::<rustc_span[28b37812f336c7b5]::span_encoding::Span, alloc[4c35cc17dd12f569]::string::String>
  19:     0x75fca824f6bd - rustc_middle[ec0047e274fe25be]::util::bug::opt_span_bug_fmt::<rustc_span[28b37812f336c7b5]::span_encoding::Span>::{closure#0}
  20:     0x75fca824f6ea - rustc_middle[ec0047e274fe25be]::ty::context::tls::with_opt::<rustc_middle[ec0047e274fe25be]::util::bug::opt_span_bug_fmt<rustc_span[28b37812f336c7b5]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x75fca824874b - rustc_middle[ec0047e274fe25be]::ty::context::tls::with_context_opt::<rustc_middle[ec0047e274fe25be]::ty::context::tls::with_opt<rustc_middle[ec0047e274fe25be]::util::bug::opt_span_bug_fmt<rustc_span[28b37812f336c7b5]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x75fca8247f67 - rustc_middle[ec0047e274fe25be]::util::bug::span_bug_fmt::<rustc_span[28b37812f336c7b5]::span_encoding::Span>
  23:     0x75fcaa92bdef - <rustc_const_eval[c0dfeea2f3bf4919]::interpret::eval_context::InterpCx<rustc_const_eval[c0dfeea2f3bf4919]::const_eval::dummy_machine::DummyMachine>>::overflowing_unary_op.cold
  24:     0x75fca67bda02 - <rustc_mir_transform[61a8aa7cac63b4d6]::known_panics_lint::ConstPropagator as rustc_middle[ec0047e274fe25be]::mir::visit::Visitor>::visit_assign
  25:     0x75fca993d83d - <rustc_mir_transform[61a8aa7cac63b4d6]::known_panics_lint::ConstPropagator as rustc_middle[ec0047e274fe25be]::mir::visit::Visitor>::visit_body
  26:     0x75fca6999566 - <rustc_mir_transform[61a8aa7cac63b4d6]::known_panics_lint::KnownPanicsLint as rustc_mir_transform[61a8aa7cac63b4d6]::pass_manager::MirLint>::run_lint
  27:     0x75fca90018cd - rustc_mir_transform[61a8aa7cac63b4d6]::pass_manager::run_passes_inner
  28:     0x75fca9395d42 - rustc_mir_transform[61a8aa7cac63b4d6]::mir_drops_elaborated_and_const_checked
  29:     0x75fca93955fd - rustc_query_impl[1888158ad4449b9b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1888158ad4449b9b]::query_impl::mir_drops_elaborated_and_const_checked::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ec0047e274fe25be]::query::erase::Erased<[u8; 8usize]>>
  30:     0x75fca938d171 - rustc_query_system[b5ee5054546adc93]::query::plumbing::try_execute_query::<rustc_query_impl[1888158ad4449b9b]::DynamicConfig<rustc_query_system[b5ee5054546adc93]::query::caches::VecCache<rustc_span[28b37812f336c7b5]::def_id::LocalDefId, rustc_middle[ec0047e274fe25be]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[1888158ad4449b9b]::plumbing::QueryCtxt, false>
  31:     0x75fca938cb2a - rustc_query_impl[1888158ad4449b9b]::query_impl::mir_drops_elaborated_and_const_checked::get_query_non_incr::__rust_end_short_backtrace
  32:     0x75fca936cff9 - rustc_interface[e7d426f81a3c67f]::passes::analysis
  33:     0x75fca936bddb - rustc_query_impl[1888158ad4449b9b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[1888158ad4449b9b]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[ec0047e274fe25be]::query::erase::Erased<[u8; 1usize]>>
  34:     0x75fca9dfb4e5 - rustc_query_system[b5ee5054546adc93]::query::plumbing::try_execute_query::<rustc_query_impl[1888158ad4449b9b]::DynamicConfig<rustc_query_system[b5ee5054546adc93]::query::caches::SingleCache<rustc_middle[ec0047e274fe25be]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[1888158ad4449b9b]::plumbing::QueryCtxt, false>
  35:     0x75fca9dfb249 - rustc_query_impl[1888158ad4449b9b]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  36:     0x75fca9c675ce - rustc_interface[e7d426f81a3c67f]::interface::run_compiler::<core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>, rustc_driver_impl[f52ddb602ce7d3c0]::run_compiler::{closure#0}>::{closure#1}
  37:     0x75fca9c54167 - std[8fa947ca3cb89c52]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e7d426f81a3c67f]::util::run_in_thread_with_globals<rustc_interface[e7d426f81a3c67f]::util::run_in_thread_pool_with_globals<rustc_interface[e7d426f81a3c67f]::interface::run_compiler<core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>, rustc_driver_impl[f52ddb602ce7d3c0]::run_compiler::{closure#0}>::{closure#1}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>
  38:     0x75fca9c53f2a - <<std[8fa947ca3cb89c52]::thread::Builder>::spawn_unchecked_<rustc_interface[e7d426f81a3c67f]::util::run_in_thread_with_globals<rustc_interface[e7d426f81a3c67f]::util::run_in_thread_pool_with_globals<rustc_interface[e7d426f81a3c67f]::interface::run_compiler<core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>, rustc_driver_impl[f52ddb602ce7d3c0]::run_compiler::{closure#0}>::{closure#1}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[19fe836d650da945]::result::Result<(), rustc_span[28b37812f336c7b5]::ErrorGuaranteed>>::{closure#2} as core[19fe836d650da945]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  39:     0x75fcab3c6cab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h32bd23449113524a
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/alloc/src/boxed.rs:2022:9
  40:     0x75fcab3c6cab - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h04c486968e15e63c
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/alloc/src/boxed.rs:2022:9
  41:     0x75fcab3c6cab - std::sys::pal::unix::thread::Thread::new::thread_start::ha93fdc6af5a412fe
                               at /rustc/378a43a06510f3e3a49c69c8de71745e6a884048/library/std/src/sys/pal/unix/thread.rs:108:17
  42:     0x75fcab16555a - <unknown>
  43:     0x75fcab1e2a3c - <unknown>
  44:                0x0 - <unknown>

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: please make sure that you have updated to the latest nightly

note: rustc 1.80.0-nightly (378a43a06 2024-05-01) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [mir_drops_elaborated_and_const_checked] elaborating drops for `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0658`.

@matthiaskrgr matthiaskrgr 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. C-bug Category: This is a bug. labels May 1, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label May 1, 2024
@Noratrieb Noratrieb added the F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` label May 1, 2024
@tgross35
Copy link
Contributor

tgross35 commented May 1, 2024

Another thing waiting on const eval, like #122587

@rustbot claim
@rustbot label +requires-incomplete-features +S-bug-has-test +S-has-mcve -needs-triage

@rustbot
Copy link
Collaborator

rustbot commented May 1, 2024

Error: Parsing assign command in comment failed: ...' claim' | error: expected end of command at >| ' label +re'...

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@rustbot rustbot added requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels May 1, 2024
tgross35 added a commit to tgross35/rust that referenced this issue Jun 13, 2024
Const eval negation was added. This test is now covered by Miri tests
and a new library test.

Fixes <rust-lang#124583>
tgross35 added a commit to tgross35/rust that referenced this issue Jun 14, 2024
Const eval negation was added. This test is now covered by Miri tests
and a new library test.

Fixes <rust-lang#124583>
tgross35 added a commit to tgross35/rust that referenced this issue Jun 14, 2024
Const eval negation was added. This test is now covered by Miri tests,
and merged into an existing UI test.

Fixes <rust-lang#124583>
tgross35 added a commit to tgross35/rust that referenced this issue Jun 14, 2024
Const eval negation was added. This test is now covered by Miri tests,
and merged into an existing UI test.

Fixes <rust-lang#124583>
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jun 15, 2024
…lfJung

Add `f16` and `f128` const eval for binary and unary operationations

Add const evaluation and Miri support for f16 and f128, including unary and binary operations. Casts are not yet included.

Fixes rust-lang#124583

r? `@RalfJung`
@bors bors closed this as completed in 3775f2f Jun 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jun 15, 2024
Rollup merge of rust-lang#126429 - tgross35:f16-f128-const-eval, r=RalfJung

Add `f16` and `f128` const eval for binary and unary operationations

Add const evaluation and Miri support for f16 and f128, including unary and binary operations. Casts are not yet included.

Fixes rust-lang#124583

r? ``@RalfJung``
github-actions bot pushed a commit to rust-lang/miri that referenced this issue Jun 17, 2024
Add `f16` and `f128` const eval for binary and unary operationations

Add const evaluation and Miri support for f16 and f128, including unary and binary operations. Casts are not yet included.

Fixes rust-lang/rust#124583

r? ``@RalfJung``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-f16_and_f128 `#![feature(f16)]`, `#![feature(f128)]` I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-incomplete-features S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants