https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64491

--- Comment #13 from Andrew Stubbs <ams at gcc dot gnu.org> ---
I thought of that, but my testcase has 2 exits.

I thought of only warning when all the exits were being removed, but the
loop->bounds list does not include all the exits, so that can't happen either.

I thought of only warning when all the loop exits are beyond the UB, but then I
realised that that's exactly what the code already does; it just doesn't help
when the loop has been turned inside out like this.

Fundamentally, the problem is that the head of the first iteration and the
effective head of the last iteration are not necessarily one and the same. I
can't see an obvious way to start the walk from somewhere else though.

In any case, the bounds reduction code does the right thing, it's just the
warning that's broken, so it might just be best to remove it.

I'd still like to have the warning though. Perhaps the best way would be to
warn at the point where the last exit is actually removed?

Reply via email to