Rust-GCC / Rust-GCC/gccrs

ICE ` attempting to expand node with id 12 into position with node id 14`

Open
#4,138 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 = add_impl! { usize u8 u16 u32 u64    f32 f64 };

struct B;

original:

// { dg-options "-w" }
type A = add_impl! { usize u8 u16 u32 u64  /*isize i8 i16 i32 i64*/  f32 f64 };

struct B;

Version information:

c742973c23448e321fba4d9ff98a9092dc0df7ba

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

Program output

crab1: internal compiler error: at mvce.rs:1:10, attempting to expand node with id 12 into position with node id 14
0x300c7d8 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:534
0xc986ba rust_be_internal_error_at(unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
	../../gcc/rust/rust-diagnostics.cc:173
0xc9877d rust_internal_error_at(unsigned long, char const*, ...)
	../../gcc/rust/rust-diagnostics.cc:182
0xeb6680 Rust::ExpandVisitor::visit(Rust::AST::MacroInvocation&)
	../../gcc/rust/expand/rust-expand-visitor.cc:518
0xeb94fe void Rust::ExpandVisitor::expand_macro_children<std::vector<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >, std::allocator<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > > >, std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > >(std::vector<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >, std::allocator<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > > >&, std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > (Rust::AST::SingleASTNode::*)())
	../../gcc/rust/expand/rust-expand-visitor.h:134
0xeb94fe Rust::ExpandVisitor::expand_inner_items(std::vector<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >, std::allocator<std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> > > >&)
	../../gcc/rust/expand/rust-expand-visitor.cc:237
0xe7aff3 Rust::Session::expansion(Rust::AST::Crate&, Rust::Resolver2_0::NameResolutionContext&)
	../../gcc/rust/rust-session-manager.cc:953
0xe87f25 Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:618
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 input and the listed compiler command. Start at Rust::ExpandVisitor::visit in gcc/rust/expand/rust-expand-visitor.cc:518, then read expand_macro_children in rust-expand-visitor.h:134; done means this input no longer aborts with the node-position internal compiler error.

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
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.