Rust-GCC / Rust-GCC/gccrs

ICE in visit, at rust/checks/errors/rust-hir-pattern-analysis.cc:404 match on ouroboros type

Open
#3,653 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
2.9k
Forks
231
Avg merge
19h 55m
Merged PRs (30d)
67

Description

auto-reduced (treereduce-rust):

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
type A = A;

fn main() {
    match A {}
}

original:

struct S(u8, u16);
type A = A;

fn main() {
    let main = A(0, 1); //~ ERROR expected function
    match A {
        A(..) => {} //~ ERROR expected function
    }
}

Version information:

765121736dfe3f5b319bbe9837880deda326394e

Possibly related line of code:
https://github.com/Rust-GCC/gccrs/blob/765121736dfe3f5b319bbe9837880deda326394e/gcc/rust/checks/errors/rust-hir-pattern-analysis.cc#L398-L410

Command:
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 -frust-incomplete-and-experimental-compiler-do-not-use

Program output

crab1: internal compiler error: in visit, at rust/checks/errors/rust-hir-pattern-analysis.cc:404
0x89483f Rust::Analysis::PatternChecker::visit(Rust::HIR::MatchExpr&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:404
0x10446d3 Rust::Analysis::PatternChecker::go(Rust::HIR::Crate&)
	../../gcc/rust/checks/errors/rust-hir-pattern-analysis.cc:48
0xce8fa8 Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:692
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the ICE with the reduced Rust case and the provided crab1 command, then inspect PatternChecker::visit(Rust::HIR::MatchExpr) in rust/checks/errors/rust-hir-pattern-analysis.cc around line 404. Done means the reduced reproducer no longer triggers an internal compiler error and produces the appropriate compiler result.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.