Closed
Description
Updating from a nightly version of rust from 2015-10-13 to one from 2016-04-25 on a medium sized codebase, I get an internal compile error.
Meta
rustc --version --verbose
:
rustc 1.10.0-nightly (bd938166d 2016-04-25)
binary: rustc
commit-hash: bd938166d6dabc689777555d5046dce893555eb7
commit-date: 2016-04-25
host: x86_64-apple-darwin
release: 1.10.0-nightly
Backtrace:
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', ../src/librustc_trans/datum.rs:789
stack backtrace:
1: 0x10e39eba8 - std::sys::backtrace::tracing::imp::write::h9fb600083204ae7f
2: 0x10e3ab015 - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hca543c34f11229ac
3: 0x10e3aab4f - std::panicking::default_hook::hc2c969e7453d080c
4: 0x10e36f9b6 - std::sys_common::unwind::begin_unwind_inner::h30e12d15ce2b2e25
5: 0x10a3bfb44 - std::sys_common::unwind::begin_unwind::h65390c63b501d6ed
6: 0x10a4d9c81 - _<datum..Datum<'tcx, K>>::to_llscalarish::h195a00339e1a572a
7: 0x10a4d97ac - _<std..vec..Vec<T> as std..iter..FromIterator<T>>::from_iter::h9d79cca6cff1d802
8: 0x10a4d0404 - rustc_trans::expr::trans_rvalue_stmt_unadjusted::hce285cdde393b03d
9: 0x10a42ff28 - rustc_trans::expr::trans_into::he1315719b2222c7c
10: 0x10a4275ce - rustc_trans::controlflow::trans_block::h4fad28c271095568
11: 0x10a4cd85a - rustc_trans::expr::trans_rvalue_dps_unadjusted::h4d8aac465b9b8fed
12: 0x10a42ff58 - rustc_trans::expr::trans_into::he1315719b2222c7c
13: 0x10a4275ce - rustc_trans::controlflow::trans_block::h4fad28c271095568
14: 0x10a42608c - rustc_trans::base::trans_closure::h83a389352ac0be25
15: 0x10a427d3d - rustc_trans::base::trans_fn::h9423938066432dd9
16: 0x10a432c07 - rustc_trans::base::trans_item::hdc785ae68a9e6500
17: 0x10a44c946 - _<base..TransItemsWithinModVisitor<'a, 'tcx> as rustc..hir..intravisit..Visitor<'v>>::visit_item::h22c1c36dec64effa
18: 0x10a44a606 - rustc::hir::intravisit::walk_item::he78478ac5852ebcf
19: 0x10a43b3be - rustc_trans::base::trans_crate::h6ed1dbd6e572a8c2
20: 0x1099b622a - rustc_driver::driver::phase_4_translate_to_llvm::hd7579aae98641824
21: 0x1099b495c - rustc_driver::driver::compile_input::_$u7b$$u7b$closure$u7d$$u7d$::he3c6b6ab9afe28dd
22: 0x1099b121d - rustc_driver::driver::phase_3_run_analysis_passes::_$u7b$$u7b$closure$u7d$$u7d$::h06c776ef4d1c70b6
23: 0x1099aac50 - rustc::ty::context::TyCtxt::create_and_enter::hb0e0e916c7274a64
24: 0x10997d65f - rustc_driver::driver::compile_input::h0629572e6f316b31
25: 0x1099602ef - rustc_driver::run_compiler::h8902aebf8b1849a8
26: 0x10995d682 - std::sys_common::unwind::try::try_fn::h4c74456035d0fcc7
27: 0x10e39c3cb - __rust_try
28: 0x10e39c353 - std::sys_common::unwind::inner_try::h47a4d9cd4a369dcd
29: 0x10995df19 - _<F as std..boxed..FnBox<A>>::call_box::h27f542a39f1d61ef
30: 0x10e3a9ee8 - std::sys::thread::Thread::new::thread_start::h6f266e069bf4ec2b
31: 0x7fff88f6d99c - _pthread_body
32: 0x7fff88f6d919 - _pthread_start
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
UnlawfulMonad commentedon Apr 28, 2016
I received the same error with this code:
Meta
Running with
RUST_BACKTRACE=1
givesand my
rustc --version --verbose
:Aatch commentedon Apr 29, 2016
@drrb while a reproduction case has been provided now, your original report didn't supply any usable information in terms of tracking down the problem. Even now it would be nice to know if your code has any similarities to @tqoitc's to help narrow down the issue.
Aatch commentedon Apr 29, 2016
Ok, so assuming that @drrb is also getting the same error, this is due to inline asm support just being generally bad.
We (currently) only support immediate operands for asm inputs, and
D32x4
isn't an immediate, however we don't actually check this until we try and load from the memory locationD32x4
is in. Inline ASM needs an overhaul, so this probably won't be fixed directly until that happens.@tqoitc While investigating this, I tried to fix your ASM so it compiled, here is the fixed version of
add
:The main changes are to the constraints, using
*m
means that this is an indirect memory operand. This does mean you need to initializeret
to something in order to take a pointer to it.I also changed to using
movups
, which is just because there's no guarantee thatself
,vec
orret
will be appropriately aligned formovaps
.drrb commentedon Apr 30, 2016
Thanks @Aatch, I'm not able to post my code, sorry. I can confirm though that I use a bit of inline ASM. I'll have a look and see if I can find any specific similarities to @tqoitc's code.
Mark-Simulacrum commentedon May 3, 2017
With @tqoitc's code sample updated to not have clobbers in braces and somewhat minimized, this is the ICE I get. Updated code is also included below.
Add compile-fail test for rust-lang#33264
Add compile-fail test for rust-lang#33264
Add test for rust-lang#33264
Rollup merge of rust-lang#81387 - c410-f3r:tests-tests-tests, r=petro…
Rollup merge of rust-lang#81387 - c410-f3r:tests-tests-tests, r=petro…