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

Rustc hangs during llvm codegen when referencing a [large] array with std::ptr::read_volatile #53730

Open
rlabrecque opened this issue Aug 27, 2018 · 3 comments
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@rlabrecque
Copy link

This issue has been repro'd on stable and nightly on Windows, OSX, and Linux:

cargo 1.28.0 (96a2c7d16 2018-07-13)
release: 1.28.0
commit-hash: 96a2c7d16249cb47c61c887fc95ca8be60e7ef0a
commit-date: 2018-07-13

cargo 1.29.0-nightly (6a7672ef5 2018-08-14)
release: 1.29.0
commit-hash: 6a7672ef5344c1bb570610f2574250fbee932355
commit-date: 2018-08-14

Code:

fn main() {
    let x = [0u8; 128 * 128 * 4];
    let _y = unsafe { std::ptr::read_volatile(&x) };
}

Thanks to @talchas for the minimal repro. I believe they were able to repro it without _volatile as well.

@talchas
Copy link

talchas commented Aug 27, 2018

To be precise, I didn't repro it in rust without _volatile; my system llc (and thus presumably from a different version) hung when attempting to compile the --emit llvm-ir output, but segfaulted when attempting to compile either

define internal void @_ZN3foo4main17hb80e1f71fc6968e1E() unnamed_addr #0 {
start:
  %_y = alloca [65536 x i8], align 1
  %0 = load volatile [65536 x i8], [65536 x i8]* %_y, align 1
  ret void
}

or

define internal void @_ZN3foo4main17hb80e1f71fc6968e1E() unnamed_addr #0 {
start:
  %_y = alloca [65536 x i8], align 1
  %0 = load [65536 x i8], [65536 x i8]* %_y, align 1
  ret void
}

which might be a related issue or not.

@nagisa
Copy link
Member

nagisa commented Aug 27, 2018

https://bugs.llvm.org/show_bug.cgi?id=37000 is the LLVM bug you see here.

@nagisa nagisa added the A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. label Aug 27, 2018
@steveklabnik
Copy link
Member

Triage: appears this is still a bug

@Nilstrieb Nilstrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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

5 participants