]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-optimization/107485 - fix non-call exception ICE with inlining
authorRichard Biener <rguenther@suse.de>
Mon, 14 Nov 2022 16:19:20 +0000 (17:19 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 14 Nov 2022 16:21:01 +0000 (17:21 +0100)
Inlining performs a wrong non-call exception fixup for VEC_COND_EXPRs
which on the branch fail to properly have the condition split out in
the first place.

PR tree-optimization/107485
* tree-inline.c (remap_gimple_stmt): Use correct type for
split out condition of [VEC_]COND_EXPRs.

gcc/tree-inline.c

index c20c25ceb50e562f1a47b684e50cefafe9450f43..658b09c07d2e556b64ee01c9cb7c54ca41aea20a 100644 (file)
@@ -1979,11 +1979,10 @@ remap_gimple_stmt (gimple *stmt, copy_body_data *id)
             || gimple_assign_rhs_code (ass) == VEC_COND_EXPR)
            && gimple_could_trap_p (ass))
          {
-           gassign *cmp
-             = gimple_build_assign (make_ssa_name (boolean_type_node),
-                                    gimple_assign_rhs1 (ass));
+           tree def = make_ssa_name (TREE_TYPE (gimple_assign_rhs1 (ass)));
+           gassign *cmp = gimple_build_assign (def, gimple_assign_rhs1 (ass));
            gimple_seq_add_stmt (&stmts, cmp);
-           gimple_assign_set_rhs1 (ass, gimple_assign_lhs (cmp));
+           gimple_assign_set_rhs1 (ass, def);
          }
     }