https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122594
Bug ID: 122594
Summary: gsi_split_seq_before is broken for singletons
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
Target Milestone: ---
If you feed gsi_split_seq_before an iterator pointing to the last and only stmt
in a sequence you get a non-empty head sequence plus a non-end updated
iterator.
The expected result is an empty head sequence.
g++.dg/torture/pr122589.C loops forever if you remove the
gimple_seq_singleton_p
check from gsi_replace_with_seq.