Skip to content

ICE: in convert_tree, at rust/rust-gcc.cc:1922 tupel destruct w ref #3645

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
fn main() {
    let (ref y, z) = (1i32, 2u32);
}

original:

fn main() {
    let (ref y,z) = (1i32, 2u32);
}

Version information:

7651217

Possibly related line of code:

gccrs/gcc/rust/rust-gcc.cc

Lines 1916 to 1928 in 7651217

|| SCALAR_FLOAT_TYPE_P (type_tree) || COMPLEX_FLOAT_TYPE_P (type_tree))
return fold_convert_loc (location, type_tree, expr_tree);
else if (TREE_CODE (type_tree) == RECORD_TYPE
|| TREE_CODE (type_tree) == UNION_TYPE
|| TREE_CODE (type_tree) == ARRAY_TYPE)
{
gcc_assert (int_size_in_bytes (type_tree)
== int_size_in_bytes (TREE_TYPE (expr_tree)));
if (TYPE_MAIN_VARIANT (type_tree)
== TYPE_MAIN_VARIANT (TREE_TYPE (expr_tree)))
return fold_build1_loc (location, NOP_EXPR, type_tree, expr_tree);
return fold_build1_loc (location, VIEW_CONVERT_EXPR, type_tree,
expr_tree);

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 convert_tree, at rust/rust-gcc.cc:1922
0x886464 Backend::convert_tree(tree_node*, tree_node*, unsigned int)
	../../gcc/rust/rust-gcc.cc:1922
0x886464 Backend::convert_tree(tree_node*, tree_node*, unsigned int)
	../../gcc/rust/rust-gcc.cc:1906
0xbd0213 Backend::temporary_variable(tree_node*, tree_node*, tree_node*, tree_node*, bool, unsigned int, tree_node**)
	../../gcc/rust/rust-gcc.cc:2117
0x1060fda Rust::Compile::CompilePatternLet::visit(Rust::HIR::TuplePattern&)
	../../gcc/rust/backend/rust-compile-pattern.cc:750
0x106cb6e Rust::Compile::CompilePatternLet::Compile(Rust::HIR::Pattern*, tree_node*, Rust::TyTy::BaseType*, unsigned int, Rust::Compile::Context*)
	../../gcc/rust/backend/rust-compile-pattern.h:111
0x106cb6e Rust::Compile::CompileStmt::visit(Rust::HIR::LetStmt&)
	../../gcc/rust/backend/rust-compile-stmt.cc:88
0x106cc8d Rust::Compile::CompileStmt::Compile(Rust::HIR::Stmt*, Rust::Compile::Context*)
	../../gcc/rust/backend/rust-compile-stmt.cc:36
0x109e6db Rust::Compile::HIRCompileBase::compile_function_body(tree_node*, Rust::HIR::BlockExpr&, Rust::TyTy::BaseType*)
	../../gcc/rust/backend/rust-compile-base.cc:591
0x10a226c Rust::Compile::HIRCompileBase::compile_function(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, 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 int, Rust::HIR::BlockExpr*, Rust::Resolver::CanonicalPath const&, Rust::TyTy::FnType*)
	../../gcc/rust/backend/rust-compile-base.cc:773
0x1068b2d Rust::Compile::CompileItem::visit(Rust::HIR::Function&)
	../../gcc/rust/backend/rust-compile-item.cc:256
0xcf15f4 Rust::Compile::CompileItem::compile(Rust::HIR::Item*, Rust::Compile::Context*, Rust::TyTy::BaseType*, unsigned int)
	../../gcc/rust/backend/rust-compile-item.h:37
0xcf15f4 Rust::Compile::CompileCrate::go()
	../../gcc/rust/backend/rust-compile.cc:48
0xcf16db Rust::Compile::CompileCrate::Compile(Rust::HIR::Crate&, Rust::Compile::Context*)
	../../gcc/rust/backend/rust-compile.cc:41
0xce90eb Rust::Session::compile_crate(char const*)
	../../gcc/rust/rust-session-manager.cc:733
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