Rust: Compiler doesn't terminate with --release

Created on 16 Jul 2020  路  8Comments  路  Source: rust-lang/rust

I tried this code:

#[derive(Copy, Clone)]
pub enum Foo {
    A,
    B(u8),
}

pub fn foo() -> Box<[[[Foo; 50]; 50]; 50]> {
    Box::new([[[Foo::A; 50]; 50]; 50])
}

I expected to see this happen:

cargo build --release

(Above command eventually should terminate)

Instead, this happened: Compiler doesn't terminate.

Meta

rustc --version --verbose:

rustc 1.44.1 (c7087fe00 2020-06-17)
rustc 1.46.0-nightly (346aec9b0 2020-07-11)

A crate with the repro can be found here: https://github.com/io12/llvm-rustc-bug-repro.

It seems like this is an LLVM bug.

A-LLVM C-bug I-hang ICEBreaker-LLVM P-medium T-compiler

Most helpful comment

It seems Box is unnecessary, slightly minimized:

#[derive(Copy, Clone)]
pub enum Foo {
    A,
    B(u8),
}

pub fn foo() -> [[[Foo; 50]; 50]; 50] {
    [[[Foo::A; 50]; 50]; 50]
}

When its nesting is a double, it will be terminated in seconds. But when it's a triple, it hangs. This doesn't seem to be _technically_ infinite, but I would label it as I-hang. Correct me if it's wrong label.

All 8 comments

It seems Box is unnecessary, slightly minimized:

#[derive(Copy, Clone)]
pub enum Foo {
    A,
    B(u8),
}

pub fn foo() -> [[[Foo; 50]; 50]; 50] {
    [[[Foo::A; 50]; 50]; 50]
}

When its nesting is a double, it will be terminated in seconds. But when it's a triple, it hangs. This doesn't seem to be _technically_ infinite, but I would label it as I-hang. Correct me if it's wrong label.

@estebank I think this is worth a nomination as you have done, but I'm interested in hearing from you what's the reason for the nomination. What's exactly what you wanted to discuss during the meeting about this issue?.

@spastorino wanted to flag it for prioritizing and assignment.

Assigning P-critical as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

We can remove I-nominated because it was requested to be assigned, but given that this is P-critical it will be tracked anyway.

This was reconsidered, per @Mark-Simulacrum's comments and we consider now P-medium.
So also re-adding I-nominated.

Anyway, given that we checked this issue slightly during our last meeting, I wanted also to check with @pnkfelix if we want this nomination up or not given that we hadn't assigned the issue yet.

@rustbot ping llvm

Hey LLVM ICE-breakers! This bug has been identified as a good
"LLVM ICE-breaking candidate". In case it's useful, here are some
[instructions] for tackling these sorts of bugs. Maybe take a look?
Thanks! <3

cc @camelid @comex @cuviper @DutchGhost @hanna-kruppe @hdhoang @heyrutvik @JOE1994 @jryans @mmilenko @nagisa @nikic @Noah-Kennedy @SiavoshZarrasvand @spastorino @vertexclique @vgxbj

self-assigning to 1. verify this is an LLVM bug and if so, 2. isolate .bc file that we can use to file bug against LLVM itself.

Was this page helpful?
0 / 5 - 0 ratings