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

Some MIR dumps differ between little and big endian #79799

Closed
oli-obk opened this issue Dec 7, 2020 · 5 comments · Fixed by #79999 or #86566
Closed

Some MIR dumps differ between little and big endian #79799

oli-obk opened this issue Dec 7, 2020 · 5 comments · Fixed by #79999 or #86566
Assignees
Labels
A-mir-opt Area: MIR optimizations E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Dec 7, 2020

in #77413 it was noted that MIR dumps in our test suite somtimes differ between little and big endian, making our test suite fail on big endian. This is just about MIR pretty printing.

All that needs to be done is to pull out

match ty.kind() {
ty::Int(_) | ty::Uint(_) | ty::Bool | ty::Char | ty::Float(_) => {}
// Unit type
ty::Tuple(tys) if tys.is_empty() => {}
ty::FnDef(..) => {}
into a separate function that returns true if the verbose printing should be used and then make it recurse on ty::Tuple and ty::Array elements.

You can then run rerun tests separately for 64bit and 32bit (the latter via e.g. --target i686-unknown-linux-gnu)

@oli-obk oli-obk added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-mir-opt Area: MIR optimizations labels Dec 7, 2020
@pierwill pierwill removed their assignment Dec 7, 2020
@hencrice
Copy link
Contributor

@rustbot claim

I would like to give this a try as my first Rust contribution :)

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 23, 2020
Refactored verbose print into a function

Also handle Tuple and Array separately, which was not explicitly checked.

Fixes rust-lang#79799.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 24, 2020
Refactored verbose print into a function

Also handle Tuple and Array separately, which was not explicitly checked.

Fixes rust-lang#79799.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 24, 2020
Refactored verbose print into a function

Also handle Tuple and Array separately, which was not explicitly checked.

Fixes rust-lang#79799.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 24, 2020
Refactored verbose print into a function

Also handle Tuple and Array separately, which was not explicitly checked.

Fixes rust-lang#79799.
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Dec 25, 2020
Refactored verbose print into a function

Also handle Tuple and Array separately, which was not explicitly checked.

Fixes rust-lang#79799.
@bors bors closed this as completed in b66eb69 Dec 25, 2020
@infinity0
Copy link
Contributor

This is still not fixed, I see the test failures still in 1.51 https://buildd.debian.org/status/fetch.php?pkg=rustc&arch=s390x&ver=1.51.0%2Bdfsg1-1%7Eexp2&stamp=1619448544&raw=0

@infinity0
Copy link
Contributor

e.g. on s390x:

-	+                                          // + literal: Const { ty: (u32, bool), val: Value(ByRef { alloc: Allocation { bytes: [2, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
+	+                                          // + literal: Const { ty: (u32, bool), val: Value(ByRef { alloc: Allocation { bytes: [0, 0, 0, 2, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [31], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }

@oli-obk oli-obk reopened this Apr 26, 2021
@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 26, 2021

we need the same fix (as the one in #79999 ) for mir::Constant

@fee1-dead
Copy link
Member

@rustbot claim

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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
5 participants