This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Detect loops in find_comparison_args


Hi Paolo,

On 5/21/2012 10:12 AM, Paolo Bonzini wrote:
That's pretty heavy-weight.  Perhaps you can try the usual algorithm of
looking at x->next and x->next->next?

That would only detect cycles of length 1 and 2 though. While that would cover all the testcases we currently know about, I wanted to eliminate the entire pattern of hangs. Otherwise it's only a question of time until someone hits a cycle of length >= 3.


We could use less memory at the expense of CPU time by using the tortoise and hare algorithm, but that would make the code much more complicated.

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]