Open
Description
auto-reduced (treereduce-rust):
//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
#![feature(exclusive_range_pattern)]
fn main() {
let x = 3;
match x {
0..-1 => 2,
_ => 3,
};
}
original:
// Make sure redundant testing paths in `match` expressions are sorted out.
#![feature(exclusive_range_pattern)]
// EMIT_MIR match_test.main.SimplifyCfg-initial.after.mir
fn main() {
let x = 3;
let b = true;
// When `(0..=10).contains(x) && !b`, we should jump to the last arm
// without testing two other candidates.
match x {
0..10 if b..=20 => 1,
-1 => 2,
_ => 3,
};
}
Version information:
Possibly related line of code:
gccrs/gcc/rust/hir/rust-ast-lower-pattern.cc
Lines 252 to 264 in 7651217
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 visit, at rust/hir/rust-ast-lower-pattern.cc:258
0x88ca23 Rust::HIR::ASTLoweringPattern::visit(Rust::AST::RangePattern&)
../../gcc/rust/hir/rust-ast-lower-pattern.cc:258
0xe6bd46 Rust::HIR::ASTLoweringPattern::translate(Rust::AST::Pattern&, bool)
../../gcc/rust/hir/rust-ast-lower-pattern.cc:33
0xe5d52e Rust::HIR::ASTLoweringExprWithBlock::visit(Rust::AST::MatchExpr&)
../../gcc/rust/hir/rust-ast-lower.cc:446
0xe7e908 Rust::HIR::ASTLoweringExprWithBlock::translate(Rust::AST::ExprWithBlock&, bool*)
../../gcc/rust/hir/rust-ast-lower-block.h:153
0xe7e908 Rust::HIR::ASTLoweringExpr::visit(Rust::AST::MatchExpr&)
../../gcc/rust/hir/rust-ast-lower-expr.cc:689
0xe87322 Rust::HIR::ASTLoweringExpr::translate(Rust::AST::Expr&, bool*)
../../gcc/rust/hir/rust-ast-lower-expr.cc:43
0xe92bb7 Rust::HIR::ASTLoweringStmt::visit(Rust::AST::ExprStmt&)
../../gcc/rust/hir/rust-ast-lower-stmt.cc:50
0xe93247 Rust::HIR::ASTLoweringStmt::translate(Rust::AST::Stmt*, bool*)
../../gcc/rust/hir/rust-ast-lower-stmt.cc:33
0xe5c00e Rust::HIR::ASTLoweringBlock::visit(Rust::AST::BlockExpr&)
../../gcc/rust/hir/rust-ast-lower.cc:122
0xe6e3ea Rust::HIR::ASTLoweringBlock::translate(Rust::AST::BlockExpr&, bool*)
../../gcc/rust/hir/rust-ast-lower-block.h:37
0xe6e3ea Rust::HIR::ASTLoweringItem::visit(Rust::AST::Function&)
../../gcc/rust/hir/rust-ast-lower-item.cc:444
0xe6f11e Rust::HIR::ASTLoweringItem::translate(Rust::AST::Item&)
../../gcc/rust/hir/rust-ast-lower-item.cc:38
0xe5cba7 Rust::HIR::ASTLowering::go()
../../gcc/rust/hir/rust-ast-lower.cc:81
0xe5d0a1 Rust::HIR::ASTLowering::Resolve(Rust::AST::Crate&)
../../gcc/rust/hir/rust-ast-lower.cc:71
0xce8eb8 Rust::Session::compile_crate(char const*)
../../gcc/rust/rust-session-manager.cc:663
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.