Open
Description
auto-reduced (treereduce-rust):
//@compile-flags: -frust-incomplete-and-experimental-compiler-do-not-use
pub enum T {
A(u64),
B,
}
pub extern "C" fn t_add(a: T, b: T) -> u64 {
match (a, b) {}
}
original:
#[repr(C, u8)]
pub enum TT {
AA(u64, u64),
BB,
}
#[no_mangle]
pub extern "C" fn tt_add(a: TT, b: TT) -> u64 {
match (a, b) {
(TT::AA(a1, b1), TT::AA(a2, b2)) => a1 + a2 + b1 + b2,
(TT::AA(a1, b1), TT::BB) => a1 + b1,
(TT::BB, TT::AA(a1, b1)) => a1 + b1,
_ => 0,
}
}
#[repr(C, u8)]
pub enum T {
A(u64),
B,
}
#[no_mangle]
pub extern "C" fn t_add(a: T, b: T) -> u64 {
match (a, b) {
(TT(a), T::A(b)) => a + b,
(T::A(a), T::B) => a,
(T::B, T::A(b)) => b,
_ => 0,
}
}
Version information:
Command:
/home/matthias/vcs/github/gccrs/gccrs-build/gcc/crab1 -frust-incomplete-and-experimental-compiler-do-not-use
Program output
/tmp/icemaker_global_tempdir.NKudfJBTYGQf/rustc_testrunner_tmpdir_reporting.6HbwrOV1kBsY/mvce.rs:6:24: warning: unused name ‘a’ [-Wunused-variable]
6 | pub extern "C" fn t_add(a: T, b: T) -> u64 {
| ^
/tmp/icemaker_global_tempdir.NKudfJBTYGQf/rustc_testrunner_tmpdir_reporting.6HbwrOV1kBsY/mvce.rs:6:30: warning: unused name ‘b’ [-Wunused-variable]
6 | pub extern "C" fn t_add(a: T, b: T) -> u64 {
| ^
Analyzing compilation unit
/tmp/icemaker_global_tempdir.NKudfJBTYGQf/rustc_testrunner_tmpdir_reporting.6HbwrOV1kBsY/mvce.rs: In function ‘mvce::t_add’:
/tmp/icemaker_global_tempdir.NKudfJBTYGQf/rustc_testrunner_tmpdir_reporting.6HbwrOV1kBsY/mvce.rs:6:5: error: non-trivial conversion in ‘constructor’
6 | pub extern "C" fn t_add(a: T, b: T) -> u64 {
| ^~~~~~
u64
struct ()
D.127 = {};
/tmp/icemaker_global_tempdir.NKudfJBTYGQf/rustc_testrunner_tmpdir_reporting.6HbwrOV1kBsY/mvce.rs:6:5: internal compiler error: ‘verify_gimple’ failed
0x184fd4e verify_gimple_in_seq(gimple*, bool)
../../gcc/tree-cfg.cc:5314
0x13f992a gimplify_body(tree_node*, bool)
../../gcc/gimplify.cc:19136
0x13f9ada gimplify_function_tree(tree_node*)
../../gcc/gimplify.cc:19252
0x11d3b97 cgraph_node::analyze()
../../gcc/cgraphunit.cc:687
0x11d6f43 analyze_functions
../../gcc/cgraphunit.cc:1251
0x11d81fd symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.cc:2558
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.