https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114151
--- Comment #15 from Andrew Macleod <amacleod at redhat dot com> --- (In reply to Richard Biener from comment #14) > (In reply to Andrew Macleod from comment #13) > > > > We would have tripped over this earlier if SCEV or one of those other places > > using range_of_expr without context had instead invoked range_of_stmt. That > > would have been perfectly reasonable, and would have resulting in these same > > issues. We never tripped over it because range_of_stmt is not used much > > outside of ranger. That is the primary reason I wanted to track this down. > > There were alternative paths to the same end result that would have > > triggered these issues. > > It sounds like this part is a bugfix? Technically yes. When I commit it to trunk, I would split this into 3 patches. 1 - The change to get_global_range to not process PHIS. This is only a bug that shows up if range_of_stmt is called from within SCEV. 2 - Make cache propagation re-entrant This is also only currently needed if SCEV invokes range_of_stmt 3 - call range_of_stmt from range_of_expr when context-less. This patch causes SCEV to call range_of_stmt indirectly through range_of_expr. I don't think the buglet would show up in the current release simply because SCEV never calls ranger with a context, and thus range_of_stmt never gets invoked by it. It might be worthwhile to put the patchset (or at least the first 2?) in the first point release after they've been committed to trunk in case something else wants to be backported which trips over it.