https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93088
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- The problem is that pend is uninitialized in the testcase and we end up with: (insn 6 70 71 14 (set (reg/v:DI 90 [ pend ]) (reg/v:DI 89 [ p ])) "pr56348.c":29:5 66 {*movdi_internal} (nil)) and (insn 9 88 63 12 (set (reg/v:DI 89 [ p ]) (reg/v:DI 90 [ pend ])) "pr56348.c":28:3 66 {*movdi_internal} (nil)) as the only setters of the two pseudos (reg:DI 89 and reg:DI 90) and on that kind of thing find_single_def_src just loops forever, alternating between the two. Hangs since r277923, but I think has been latent since r146700 aka https://gcc.gnu.org/ml/gcc-patches/2009-04/msg00246.html Guess a fix could be either to add some counter and punt after following e.g. 128 single definition pseudos with REG_P SET_SRCs, or add a hash_set or bitmap or whatever to record pseudos we've seen already and punt when we notice a loop, or combine both ways, start with handling a few without a bitmap/hash_set and only after certain amount keep track on what we've seen and punt when we see something again. Though, even with a hash_set/bitmap, having unbounded search might result in bad compilation complexity, if we have many loops with similar pseudos that require extremely deep searches.