Skip to content

Test for repr-transparent-aggregates-1.rs fails cross-compiling wasm32-unknown-unknown with LLVM 11.0 #81189

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

Open
sundbry opened this issue Jan 19, 2021 · 1 comment
Labels
A-repr Area: the `#[repr(stuff)]` attribute C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sundbry
Copy link

sundbry commented Jan 19, 2021

This test fails on rust-1.49 cross compiling wasm32-unknown-unknown with LLVM 11.0. It looks like the intermediate representation for a void function has significantly changed from what is expected (see attached .ll file).

repr-transparent-aggregates-1.ll
Guix Build log rust-1.49.0.drv.txt.gz

Actual code generated for test_BigS:

; Function Attrs: nounwind
define %BigS @test_BigS(%BigS %0) unnamed_addr #0 {
start:
  %1 = alloca %BigS, align 4
  %_1 = alloca %BigS, align 4
  store %BigS %0, %BigS* %_1, align 4
  br label %bb1

bb1:                                              ; preds = %bb1, %start
  call void @llvm.sideeffect()
  br label %bb1
}

Error (expected function signature):

/tmp/guix-build-rust-1.49.0.drv-0/rustc-1.49.0-src/src/test/codegen/repr-transparent-aggregates-1.rs:37:11: error: CHECK: expected string not found in input
// CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS:.*]], %BigS* [[BIGS_ARG_ATTRS1:.*]] byval(%BigS) [[BIGS_ARG_ATTRS2:.*]])
          ^
/tmp/guix-build-rust-1.49.0.drv-0/rustc-1.49.0-src/build/x86_64-unknown-linux-gnu/test/codegen/repr-transparent-aggregates-1/repr-transparent-aggregates-1.ll:1:1
: note: scanning from here
; ModuleID = 'repr_transparent_aggregates_1.3a1fbbbh-cgu.0'
^
/tmp/guix-build-rust-1.49.0.drv-0/rustc-1.49.0-src/build/x86_64-unknown-linux-gnu/test/codegen/repr-transparent-aggregates-1/repr-transparent-aggregates-1.ll:16:
1: note: possible intended match here
define %BigS @test_BigS(%BigS %0) unnamed_addr #0 {

Related discussion regarding unstable IR code gen: #74396 (comment)

@sundbry sundbry added C-bug Category: This is a bug. 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. labels Jan 19, 2021
@jonas-schievink jonas-schievink added the O-wasm Target: WASM (WebAssembly), http://webassembly.org/ label Jan 19, 2021
@Enselic
Copy link
Member

Enselic commented Sep 3, 2023

Triage: What are the commands to reproduce the ICE? I tried this, but I'm probably doing something wrong:

curl -JLO https://raw.githubusercontent.com/rust-lang/rust/582071c1ebd5ec19ded8648223e9108b5ce65d85/src/test/codegen/repr-transparent-aggregates-1.rs
rustup install nightly-2021-01-26
rustup target add wasm32-unknown-unknown --toolchain nightly-2021-01-26
rustc +nightly-2021-01-26 repr-transparent-aggregates-1.rs --target wasm32-unknown-unknown

@workingjubilee workingjubilee added the A-repr Area: the `#[repr(stuff)]` attribute label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-repr Area: the `#[repr(stuff)]` attribute C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-wasm Target: WASM (WebAssembly), http://webassembly.org/ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants