https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103288
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |pinskia at gcc dot
gnu.org
Status|NEW |ASSIGNED
--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This fixes the problem:
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 6b22f6bedd4..d96ca690d2f 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -1462,6 +1462,9 @@ value_replacement (basic_block cond_bb, basic_block
middle_bb,
prep_stmt[prep_cnt] = g;
}
+ if (!single_pred_p (middle_bb))
+ return 0;
+
/* Only transform if it removes the condition. */
if (!single_non_singleton_phi_for_edges (phi_nodes (gimple_bb (phi)), e0,
e1))
return 0;
I still need to test it a little bit.