On Tue, Jun 10, 2025 at 09:59:33AM -0400, Andrew MacLeod wrote: > Yes, there are places , particularly fold_using_range in > gimple-range-fold.cc, which expects there to be 2 edges to a GCOND stmt. > it always expects 2 successors. There are not many places like that, many > simply look at the specified edge of a gcond... but the few there are > could also be adjusted pretty easily to check if the edge is there before > doing anything...
Yeah, I've noticed that GCOND case before I've deferred cleaning of the EDGE_TRUE_VALUE and EDGE_FALSE_VALUE flags from the GCOND edges. Now those are cleared later but for the 1 removed edge I don't have a testcase. That was the gcc_checking_assert (e->flags & (EDGE_TRUE_VALUE | EDGE_FALSE_VALUE)); assert failing in gcond_edge_range. But I don't see where it would now assume there must be 2 edges rather than just one of those, gcond_edge_range simply has to be called on some edges and it can't be called on an edge which doesn't exist. If it is called on the remaining edge which still has either EDGE_TRUE_VALUE or EDGE_FALSE_VALUE flag set, it should properly get the range from that edge depending on if it is for true or false condition. Jakub