* [PATCH] tree-optimization/107485 - fix non-call exception ICE with inlining
@ 2022-11-14 18:08 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2022-11-14 18:08 UTC (permalink / raw)
To: gcc-patches
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.
Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed to
the GCC 10 branch which is the only one this code snippet prevails.
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 | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index c20c25ceb50..658b09c07d2 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -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);
}
}
--
2.35.3
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-14 18:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 18:08 [PATCH] tree-optimization/107485 - fix non-call exception ICE with inlining Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).