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

Rustup #425

Merged
merged 12 commits into from
Aug 14, 2018
Merged

Rustup #425

merged 12 commits into from
Aug 14, 2018

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Aug 7, 2018

No description provided.

}
Value::Scalar(_) => self.write_value(ValTy { value: Value::Scalar(Scalar::null(dest_layout.size).into()), ty: dest_layout.ty }, dest)?,
Value::ScalarPair(..) => {
self.write_value(ValTy { value: Value::ScalarPair(Scalar::null(dest_layout.size).into(), Scalar::null(dest_layout.size).into()), ty: dest_layout.ty }, dest)?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this not use the usual memory write functions, but special-case locals?

(I realize you did not change this, but I am still curious and this might be a good time to add a comment.^^)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The memory write functions would force an allocation... at least for uninit. not sure why init is implemented the same way, it does need the allocation for bigger things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Would be nice to have a comment along those lines.

@@ -629,21 +618,24 @@ impl<'a, 'mir, 'tcx> EvalContextExt<'tcx> for EvalContext<'a, 'mir, 'tcx, super:
}

"uninit" => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question as for init

@RalfJung RalfJung closed this Aug 14, 2018
@RalfJung RalfJung reopened this Aug 14, 2018
@RalfJung
Copy link
Member

Uh, strange assertion failures in cast.rs when running for a foreign architecture...

@RalfJung
Copy link
Member

RalfJung commented Aug 14, 2018

@oli-obk
Copy link
Contributor Author

oli-obk commented Aug 14, 2018

try running the code with RUST_LOG=rustc_mir::interpret

@RalfJung
Copy link
Member

I first have to compile latest rustc with debug assertions to get there...

@RalfJung
Copy link
Member

I am afraid I have no idea how to debug this. My self-compiled rust does not have a 32bit libstd, building one with xargo does not work (see #202), and using https://github.com/kennytm/rustup-toolchain-install-master/ does not help either as it seems we do not have a 32bit alt build.

@RalfJung
Copy link
Member

Finally, got a debug setup. For the record:
I changed Xargo.toml to

[dependencies]
core = {stage = 1}
compiler_builtins = {stage = 2}

then ran

XARGO_RUST_SRC=~/src/rust/rustc.2/src RUSTFLAGS='-Zalways-encode-mir -Zmir-emit-validate=1' xargo build --target i686-unknown-linux-gnu

and patched the code of a failing testcase to not require std:

#![feature(panic_implementation)]
#![feature(lang_items)]
#![no_std]
use core::panic::PanicInfo;

#[panic_implementation]
fn my_panic(pi: &PanicInfo) -> ! {
    loop {}
}

#[lang = "eh_personality"] extern fn eh_personality() {}

fn main() {
    assert_eq!(core::char::from_u32('x' as u32), Some('x'));
}

@RalfJung
Copy link
Member

RalfJung commented Aug 14, 2018

Yeah that looks wrong

Casting Bits { size: 4, bits: 1 }: u64 to isize

we should never have a u64 with size 4...

Seems the value is coming from

_4 = const core::intrinsics::discriminant_value(move _5)

@RalfJung RalfJung force-pushed the rustup branch 3 times, most recently from 50dbdbb to 6789a46 Compare August 14, 2018 16:45
@RalfJung RalfJung force-pushed the rustup branch 2 times, most recently from 8f35cd1 to 3be3c1f Compare August 14, 2018 17:13
@RalfJung
Copy link
Member

What, why does that one commit work now...?

Oh. AppVeyor does not actually test the given commit. It tests the PR at the time the queue proceeds far enough. WTF?!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants