Skip to content

ICE expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type or bitint_type, have error_mark in get_type_static_bounds #3922

@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
struct S(
    [u8; {
        {
            struct Z;
            0
        }
        0
    }],
);

original:

struct S([u8; { { struct Z; 0 } 0 }]);

fn main() {}

Version information:

5c3e2ad

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

Program output

/tmp/icemaker_global_tempdir.EwkIPG3XXC2E/rustc_testrunner_tmpdir_reporting.I1Qdpb71z6PL/mvce.rs:3:9: error: mismatched types, expected ‘()’ but got ‘<integer>’ [E0308]
    3 |         {
      |         ^
crab1: internal compiler error: tree check: expected integer_type or enumeral_type or boolean_type or real_type or fixed_point_type or bitint_type, have error_mark in get_type_static_bounds, at tree.cc:8405
0x2fec938 internal_error(char const*, ...)
	../../gcc/diagnostic-global-context.cc:517
0xa7e17c tree_check_failed(tree_node const*, char const*, int, char const*, ...)
	../../gcc/tree.cc:9102
0xa8012c tree_check6(tree_node const*, char const*, int, char const*, tree_code, tree_code, tree_code, tree_code, tree_code, tree_code)
	../../gcc/tree.h:4119
0xa8012c get_type_static_bounds(tree_node const*, __mpz_struct*, __mpz_struct*)
	../../gcc/tree.cc:8405
0x1163058 Rust::Compile::CompileExpr::compile_integer_literal(Rust::HIR::LiteralExpr const&, Rust::TyTy::BaseType const*)
	../../gcc/rust/backend/rust-compile-expr.cc:1626
0x11643a4 ???
	../../gcc/rust/backend/rust-compile-expr.h:38
0x1162ab6 Rust::Compile::CompileExpr::Compile(Rust::HIR::Expr&, Rust::Compile::Context*)
	../../gcc/rust/backend/rust-compile-expr.cc:48
0x1170c64 Rust::Compile::CompileBlock::visit(Rust::HIR::BlockExpr&)
	../../gcc/rust/backend/rust-compile-block.cc:64
0x117112e Rust::Compile::CompileBlock::compile(Rust::HIR::BlockExpr&, Rust::Compile::Context*, Bvariable*)
	../../gcc/rust/backend/rust-compile-block.cc:35
0x116069b ???
	../../gcc/rust/backend/rust-compile-expr.h:50
0x1162ab6 Rust::Compile::CompileExpr::Compile(Rust::HIR::Expr&, Rust::Compile::Context*)
	../../gcc/rust/backend/rust-compile-expr.cc:48
0x11596d0 ???
	../../gcc/rust/backend/rust-compile-stmt.h:33
0x11599bc Rust::Compile::CompileStmt::Compile(Rust::HIR::Stmt*, Rust::Compile::Context*)
	../../gcc/rust/backend/rust-compile-stmt.cc:36
0x118a83c Rust::Compile::HIRCompileBase::compile_function_body(tree_node*, Rust::HIR::BlockExpr&, Rust::TyTy::BaseType*)
	../../gcc/rust/backend/rust-compile-base.cc:613
0x118e9d4 Rust::Compile::HIRCompileBase::compile_constant_item(unsigned int, Rust::TyTy::BaseType*, Rust::TyTy::BaseType*, Rust::Resolver::CanonicalPath const&, Rust::HIR::Expr&, unsigned long, unsigned long)
	../../gcc/rust/backend/rust-compile-base.cc:865
0x118ee84 Rust::Compile::HIRCompileBase::compile_constant_expr(Rust::Compile::Context*, unsigned int, Rust::TyTy::BaseType*, Rust::TyTy::BaseType*, Rust::Resolver::CanonicalPath const&, Rust::HIR::Expr&, unsigned long, unsigned long)
	../../gcc/rust/backend/rust-compile-base.cc:573
0x118ee84 Rust::Compile::HIRCompileBase::query_compile_const_expr(Rust::Compile::Context*, Rust::TyTy::BaseType*, Rust::HIR::Expr&)
	../../gcc/rust/backend/rust-compile-base.cc:588
0x10831bc Rust::Resolver::TypeCheckType::visit(Rust::HIR::ArrayType&)
	../../gcc/rust/typecheck/rust-hir-type-check-type.cc:717
0x10823f7 Rust::Resolver::TypeCheckType::Resolve(Rust::HIR::Type&)
	../../gcc/rust/typecheck/rust-hir-type-check-type.cc:71
0x1083837 Rust::Resolver::TypeCheckType::Resolve(Rust::HIR::Type&)
	../../gcc/rust/typecheck/rust-hir-type-check-type.cc:67
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

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions