http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57676
--- Comment #2 from Vladimir Makarov <vmakarov at gcc dot gnu.org> --- That is a pretty interesting test case. Roughly speaking, we have chains of divmodsi4 insns: p1 / p2 ... p3 / p1 P1 (and many others) gets AX. But it is necessary for P3 in the second insn. So on each LRA pass, there is a generation of reloads for one pseudo as P1. For these test case, LRA needs 36 passes (on each pass only 2 insns are processed). The current max number of passes is 30. The simplest solution is to increase the max number of passes (and I probably do it as the first solution). But it is not the best solution as we don't know how long the insn chain can be. We need something smarter but currently I have no ideas how to do it for any length of such insn chain.