https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80025
--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Bernd Schmidt from comment #12) > That still doesn't seem to address the root cause though? Isn't the problem > that this reversible mappings code can create cycles and we should avoid > creating these in the first place? They can create cycles, but we can't avoid creating them generally, they are very important for the debug info quality; if there is no cycle, it isn't a problem, and determining whether there is a cycle is hard, because the locs lists aren't cast in stone, they actually can have further locs added or removed as the cselib processing goes on; and rtx_equal_for_cselib_1 is used while they are still in flux. Furthermore, even if there is a cycle, the comparison function might not run into the cycle. With the cap the comparison function might try to use some other location in another recursion level and be successful.