https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109192
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andrew Macleod from comment #7) > Created attachment 54716 [details] > proposed patch > > This is due to the latter part of the specified patch. We normally > terminate outgoing range calculations once the LHS has reverted to VARYING > as we won't learn anything new. > > The original patch modified this such that if there was a relation present, > we continued calculating as the relation may provide new information, as per > the original PR. > > The problem exposed in this PR is that the presence of a relation doesn't > mean that relation can actually affect the range. This PR shows many > relations, none of which are relevant, and with the quadratic nature of the > path query, it makes things quite bad. > > The attached patch is in testing. It adds a check to determine if the > relation can affect the outgoing range or not by checking if the operands > are used in the calculation or not. If they are not in the definition > chain, they can have no impact, and we stop the attempt. Sounds reasonable without knowing all the details in the implementation. How does it affect compile-times on the testcase?