Skip to content

ICE in to_attribute, at rust/ast/rust-ast.cc:4132 cfg_attr #4164

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
#[cfg_attr(target_arch = "x86_64", path = (target_arch = "x86",    path = "x86.rs"))]
mod imp;

original:

#[cfg_attr(target_arch = "x86",    path = "x86.rs")]
#[cfg_attr(target_arch = "x86_64", path = (target_arch = "x86",    path = "x86.rs"))]
mod imp;

Version information:

4db0cf7

Possibly related line of code:

gccrs/gcc/rust/ast/rust-ast.cc

Lines 4126 to 4138 in 4db0cf7

std::move (new_seq_container));
}
Attribute
MetaItemPathExpr::to_attribute () const
{
rust_assert (expr->is_literal ());
auto &lit = static_cast<LiteralExpr &> (*expr);
return Attribute (path, std::unique_ptr<AttrInputLiteral> (
new AttrInputLiteral (lit)));
}
std::vector<Attribute>

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 to_attribute, at rust/ast/rust-ast.cc:4132
0x301e249 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:786
0xc22881 fancy_abort(char const*, int, char const*)
	../../gcc/diagnostics/context.cc:1787
0x900a7b Rust::AST::MetaItemPathExpr::to_attribute() const
	../../gcc/rust/ast/rust-ast.cc:4132
0xde41cf Rust::AST::AttrInputMetaItemContainer::separate_cfg_attrs() const
	../../gcc/rust/ast/rust-ast.cc:4151
0xdf1577 Rust::AST::Attribute::separate_cfg_attrs() const
	../../gcc/rust/ast/rust-ast.cc:4209
0xeac891 Rust::expand_cfg_attrs(std::vector<Rust::AST::Attribute, std::allocator<Rust::AST::Attribute> >&)
	../../gcc/rust/expand/rust-cfg-strip.cc:118
0xeae63b Rust::CfgStrip::visit(Rust::AST::Module&)
	../../gcc/rust/expand/rust-cfg-strip.cc:1768
0xe4186f void Rust::AST::DefaultASTVisitor::visit<Rust::AST::Item>(std::unique_ptr<Rust::AST::Item, std::default_delete<Rust::AST::Item> >&)
	../../gcc/rust/ast/rust-ast-visitor.h:422
0xe4186f Rust::AST::DefaultASTVisitor::visit(Rust::AST::Crate&)
	../../gcc/rust/ast/rust-ast-visitor.cc:39
0xeaee79 Rust::CfgStrip::visit(Rust::AST::Crate&)
	../../gcc/rust/expand/rust-cfg-strip.cc:165
0xe7a118 Rust::Session::expansion(Rust::AST::Crate&, Rust::Resolver2_0::NameResolutionContext&)
	../../gcc/rust/rust-session-manager.cc:943
0xe87165 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions