Rust-GCC / Rust-GCC/gccrs

ICE in visit, at rust/hir/rust-ast-lower-pattern.cc:115

Open
#3,589 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):

pub struct Foo<T> {
    data: T,
}

fn foo<T>(Foo { .. }: Foo<T>) {}

original:

// run-pass
#![allow(dead_code)]


// pretty-expanded FIXME #23616

pub struct Foo<T> {
    data: T,
}

fn foo<T>(Foo{..}: Foo<T>) {
}

pub fn main() {
}

Version information:

34b0a681598d52de442a0a21c3a7df20bf1485bc

Possibly related line of code:
https://github.com/Rust-GCC/gccrs/blob/34b0a681598d52de442a0a21c3a7df20bf1485bc/gcc/rust/hir/rust-ast-lower-pattern.cc#L109-L121

Command:
crab1 -Warray-bounds -mtune=generic -march=x86-64 -O0 -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib64 -frust-incomplete-and-experimental-compiler-do-not-use

Program output

crab1: internal compiler error: in visit, at rust/hir/rust-ast-lower-pattern.cc:115
0x866a0a Rust::HIR::ASTLoweringPattern::visit(Rust::AST::StructPattern&)
	../../gcc/rust/hir/rust-ast-lower-pattern.cc:115
0xddef06 Rust::HIR::ASTLoweringPattern::translate(Rust::AST::Pattern&, bool)
	../../gcc/rust/hir/rust-ast-lower-pattern.cc:33
0xde136d Rust::HIR::ASTLoweringItem::visit(Rust::AST::Function&)
	../../gcc/rust/hir/rust-ast-lower-item.cc:425
0xde22de Rust::HIR::ASTLoweringItem::translate(Rust::AST::Item&)
	../../gcc/rust/hir/rust-ast-lower-item.cc:38
0xdcfd67 Rust::HIR::ASTLowering::go()
	../../gcc/rust/hir/rust-ast-lower.cc:81
0xdd0261 Rust::HIR::ASTLowering::Resolve(Rust::AST::Crate&)
	../../gcc/rust/hir/rust-ast-lower.cc:71
0xc5c258 Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:663
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

Start with rust/hir/rust-ast-lower-pattern.cc around line 115 and reproduce the ICE using the reduced Rust input and the crab1 command in the issue. Trace the StructPattern visit path shown in the backtrace, then verify that compiling the reduced example no longer reports an internal compiler error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.