Rust-GCC / Rust-GCC/gccrs

ICE `ìn compile_function_body, at rust/backend/rust-compile-base.cc:638`

Open
#3,956 2 comments 0 reactions 1 assignee View on GitHub

@philberty is already working on this.

Since Jul 31, 2025.

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

Description

Code
#![crate_type = "lib"]

pub enum E {
    A,
}

pub fn exhaustive_match(e: E) -> u8 {
    match e {
        E::u8 => 0,
    }
}

Meta
  • What version of Rust GCC were you using, git sha if possible.
    5dc8c4d20d62462ebce137c6e5146235ab9e9e2e
<output>
Backtrace

crab1: internal compiler error: in compile_function_body, at rust/backend/rust-compile-base.cc:638
0x2fecaf8 internal_error(char const*, ...)
  ../../gcc/diagnostic-global-context.cc:517
0xc0e04d fancy_abort(char const*, int, char const*)
  ../../gcc/diagnostic.cc:1803
0x90ff09 Rust::Compile::HIRCompileBase::compile_function_body(tree_node*, Rust::HIR::BlockExpr&, Rust::TyTy::BaseType*)
  ../../gcc/rust/backend/rust-compile-base.cc:638
0x118d980 Rust::Compile::HIRCompileBase::compile_function(bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, tl::optional<Rust::HIR::SelfParam>&, std::vector<Rust::HIR::FunctionParam, std::allocator<Rust::HIR::FunctionParam> >&, Rust::HIR::FunctionQualifiers const&, Rust::HIR::Visibility&, std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >&, unsigned long, Rust::HIR::BlockExpr*, Rust::Resolver::CanonicalPath const&, Rust::TyTy::FnType*)
  ../../gcc/rust/backend/rust-compile-base.cc:791
0x1158051 Rust::Compile::CompileItem::visit(Rust::HIR::Function&)
  ../../gcc/rust/backend/rust-compile-item.cc:220
0xdbeeeb Rust::Compile::CompileItem::compile(Rust::HIR::Item*, Rust::Compile::Context*, Rust::TyTy::BaseType*, unsigned long)
  ../../gcc/rust/backend/rust-compile-item.h:37
0xdbeeeb Rust::Compile::CompileCrate::go()
  ../../gcc/rust/backend/rust-compile.cc:48
0xdbeeeb Rust::Compile::CompileCrate::Compile(Rust::HIR::Crate&, Rust::Compile::Context*)
  ../../gcc/rust/backend/rust-compile.cc:41
0xdb9970 Rust::Session::compile_crate(char const*)
  ../../gcc/rust/rust-session-manager.cc:732
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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.