https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90393

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Without const:

struct S {
    S() = default;
    S(const S&) {}
};

S f() {
    S m;
    return true ? m : throw 0;
}

int main() {}

I see a different ICE:

90393.C: In function ‘S f()’:
90393.C:8:29: internal compiler error: in gimplify_return_expr, at
gimplify.c:1542
    8 |     return true ? m : throw 0;
      |                             ^
0xf8cf19 gimplify_return_expr
        /home/mpolacek/src/gcc/gcc/gimplify.c:1542
0xfbce53 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/mpolacek/src/gcc/gcc/gimplify.c:12725
0xf9e8de gimplify_stmt(tree_node**, gimple**)
        /home/mpolacek/src/gcc/gcc/gimplify.c:6709
0xf9de25 gimplify_cleanup_point_expr
        /home/mpolacek/src/gcc/gcc/gimplify.c:6452
0xfbd63e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/mpolacek/src/gcc/gcc/gimplify.c:12841
0xf9e8de gimplify_stmt(tree_node**, gimple**)
        /home/mpolacek/src/gcc/gcc/gimplify.c:6709
0xf8deb3 gimplify_statement_list
        /home/mpolacek/src/gcc/gcc/gimplify.c:1788
0xfbd9eb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/mpolacek/src/gcc/gcc/gimplify.c:12893
0xf9e8de gimplify_stmt(tree_node**, gimple**)
        /home/mpolacek/src/gcc/gcc/gimplify.c:6709
0xf8c5c5 gimplify_bind_expr
        /home/mpolacek/src/gcc/gcc/gimplify.c:1356
0xfbca9b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        /home/mpolacek/src/gcc/gcc/gimplify.c:12665
0xf9e8de gimplify_stmt(tree_node**, gimple**)
        /home/mpolacek/src/gcc/gcc/gimplify.c:6709
0xfc0419 gimplify_body(tree_node*, bool)
        /home/mpolacek/src/gcc/gcc/gimplify.c:13673
0xfc0c0a gimplify_function_tree(tree_node*)
        /home/mpolacek/src/gcc/gcc/gimplify.c:13817
0xd2b04f cgraph_node::analyze()
        /home/mpolacek/src/gcc/gcc/cgraphunit.c:667
0xd2c9a2 analyze_functions
        /home/mpolacek/src/gcc/gcc/cgraphunit.c:1126
0xd31a87 symbol_table::finalize_compilation_unit()
        /home/mpolacek/src/gcc/gcc/cgraphunit.c:2837
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to