https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101523
--- Comment #40 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Segher Boessenkool from comment #39)
> (In reply to Richard Biener from comment #37)
> > Created attachment 57753 [details]
> > quick attempt at a limit
> >
> > So like this?
>
> Hrm. It should be possible to not have the same test 28 times. Just at one
> spot!
Not sure. We loop over log-links multiple times. You could argue we
should only call try_combine once ;) But yeah, it's not very pretty,
agreed. We could pass the counter to try_combine and have a special
return value, (void *)-1 for the failed-and-exhausted case, handling
that in retry: like
retry:
if (next == NULL || next == (void *)-1)
attempts = 0;
then only the last case where we mangle 'set' and have to restore it on
failure would need special casing (and of course try_combine itself).
But in a way that's also ugly so I guess I stay with my proposal.
At least until somebody actually tried if and how much it helps (and for which
values of the --param).