https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118922
--- Comment #21 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #20) > So the issue is empty_or_with_defined_p is true but the middle_bb has a phi > in it. > And that is the fix rather previous patch here. Note before r12-5300 the phi node detection would not be needed as equal would be false, while maybe_equal_p would be true, the check for single_non_singleton_phi_for_edges would be false and the phi on the middle bb would be unused so it would be safe to remove. Changing the definition of empty_or_with_defined_p to say no phi nodes for the middle bb, might cause some missed optimization but that number is going to be small as a different pass before should have removed the unused phi nodes in the first place.