Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upICE: librustc_trans/mir/constant.rs:682: Unexpected non-fat-pointer operand #38942
Comments
This comment has been minimized.
This comment has been minimized.
|
Inline assembly cannot be an issue as this is an ICE on stable rustc. #38727 is fixed on nightly, so you’ll have to test/do travis run on i686 apple with nightly rustc. |
fenollp
added a commit
to voidstarHQ/minrs
that referenced
this issue
Jan 9, 2017
This comment has been minimized.
This comment has been minimized.
|
Here's a Travis run on nightly rustc with i686 apple platform: https://travis-ci.org/fenollp/minrs/jobs/190236515#L233 That bug looks fixed. However now I have
which Google doesn't seem to know about! |
fenollp
added a commit
to voidstarHQ/minrs
that referenced
this issue
Jan 9, 2017
This comment has been minimized.
This comment has been minimized.
|
cc @eddyb @Mark-Simulacrum stuff related to type_is_immediate change could have caused this. |
fenollp
added a commit
to voidstarHQ/minrs
that referenced
this issue
Jan 10, 2017
This comment has been minimized.
This comment has been minimized.
brson
added
regression-from-stable-to-nightly
I-ICE
labels
Jan 11, 2017
fenollp
changed the title
ICE: librustc_trans/mir/operand.rs:82: impossible case reached
ICE: librustc_trans/mir/constant.rs:682: Unexpected non-fat-pointer operand
Jan 12, 2017
brson
added
T-compiler
P-high
labels
Jan 12, 2017
This comment has been minimized.
This comment has been minimized.
|
So all it takes to reproduce is building https://github.com/fenollp/minrs on an i686-mac? |
This comment has been minimized.
This comment has been minimized.
|
Or must it specifically be run on travis? If so, we should try to isolate what is different there! |
This comment has been minimized.
This comment has been minimized.
|
Assigning to @pnkfelix for now, who will attempt to reproduce with a cross-compile. |
nikomatsakis
assigned
pnkfelix
Jan 12, 2017
This comment has been minimized.
This comment has been minimized.
|
Summary: I have now managed to reproduce. Steps follow. Initial comment: Hmm, well I think I have the cross-compile set up now (I wrote the steps I followed below), but I think I am hitting the first ICE described ("internal compiler error: ../src/librustc_trans/mir/operand.rs:82: impossible case reached"), so I have not yet replicated the "Unexpected non-fat-pointer operand"). Steps to set up cross compile
Update: but then again, with the stable channel I am hitting the same ICE ...? Maybe I still have something wrong here. Update to update: I think I misread some of the initial discussion; the original description was filed against stable, so I cannot actually compare against a stable version because it is guaranteed to hit the described ICE. I'm going to see if changing my particular nightly changes anything here. Okay, backtracking to the specific nightly of So, how to do that:
|
This comment has been minimized.
This comment has been minimized.
|
Can you use |
This comment has been minimized.
This comment has been minimized.
|
Talked to @eddyb on IRC. The last line of output from the rust log for
|
This comment has been minimized.
This comment has been minimized.
|
I noticed this before, might be of interest:
appears when the constant.rs bug gets triggered, however the operand.rs one has |
This comment has been minimized.
This comment has been minimized.
|
@fenollp Ah that would definitely be able to trigger 2 distinct bugs. |
This comment has been minimized.
This comment has been minimized.
|
Okay here is a minimized example for the unexpected fat pointer operand ICE. It only comes up with i686 (-apple-darwin), though hopefully that is not relevant), not with x86_64 Code: // This causeds an ICE when targeting i686-apple-darwin (from a
// x86_64-apple-darwin host).
#![crate_name = "cocoa"]
#![crate_type = "rlib"]
#![allow(non_upper_case_globals)]
pub mod appkit {
use std::fmt::{self};
#[repr(u64)]
pub enum NSEventType {
NSEventTypePressure = 34,
}
pub struct NSEventMask {
bits: u64,
}
pub const NSEventMaskPressure: NSEventMask =
NSEventMask{bits: 1 << (NSEventType::NSEventTypePressure as u64),};
impl fmt::Debug for NSEventMask {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
if NSEventMaskPressure.bits != 0 {
match f.write_str("NSEventMaskPressure") {
Ok(val) => val,
Err(err) => {
return Err(From::from(err))
}
}
}
Ok(())
}
}
}And here's the run:
|
This comment has been minimized.
This comment has been minimized.
|
Also reproduced minimized example still ICE's with a more recent nightly:
|
This comment has been minimized.
This comment has been minimized.
|
Oh this is a non-immediate |
pnkfelix
added
the
E-needstest
label
Jan 13, 2017
This comment has been minimized.
This comment has been minimized.
|
The more-minimal version. Thanks for minimizing @pnkfelix! #![crate_type = "rlib"]
#[repr(u64)]
pub enum NSEventType {
NSEventTypePressure,
}
pub const A: u64 = NSEventType::NSEventTypePressure as u64;
fn banana() -> u64 {
A
} |
This comment has been minimized.
This comment has been minimized.
|
(if #38854 does fix it, we probably should try to add this as a regression test if possible before closing, assuming we can readily do cross target unit test.) |
This comment has been minimized.
This comment has been minimized.
|
Do you even need the shift? I bet it's just the cast. The test doesn't need to be special as long as we build for 32-bit targets, it will get caught. |
fenollp commentedJan 9, 2017
Here is the Travis job that fails: https://travis-ci.org/fenollp/minrs/jobs/190200414
Which is part of this build https://travis-ci.org/fenollp/minrs/builds/190200409
This only happens on
i686-apple-darwin& on Travis' OSX hardware.Possibly linked: #38727 #16383 #37437 #38735