Re: [PATCH] Detect loops in find_comparison_args

2012-07-27 Thread Paolo Bonzini
Il 26/07/2012 22:22, Sandra Loosemore ha scritto: Aha, I honestly couldn't figure out that was what you were trying to catch with the version you posted previously. How about this one? Tested as before. Yeah, that's cleaner. Paolo

Re: [PATCH] Detect loops in find_comparison_args

2012-07-26 Thread Paolo Bonzini
Il 26/07/2012 04:25, Sandra Loosemore ha scritto: On 07/25/2012 01:27 AM, Paolo Bonzini wrote: What I'm worried about is the extra cost of malloc-ing and free-ing the pointer set. Perhaps you can skip the pointer set creation in the common case where find_comparison_args does not iterate?

Re: [PATCH] Detect loops in find_comparison_args

2012-07-26 Thread Sandra Loosemore
On 07/26/2012 01:28 AM, Paolo Bonzini wrote: Il 26/07/2012 04:25, Sandra Loosemore ha scritto: On 07/25/2012 01:27 AM, Paolo Bonzini wrote: What I'm worried about is the extra cost of malloc-ing and free-ing the pointer set. Perhaps you can skip the pointer set creation in the common case

Re: [PATCH] Detect loops in find_comparison_args

2012-07-26 Thread Richard Henderson
On 07/26/2012 01:22 PM, Sandra Loosemore wrote: 2012-07-26 Andrew Jenner and...@codesourcery.com Sandra Loosemore san...@codesourcery.com gcc/ * cse.c (find_comparison_args): Check for cycles of any length. gcc/testsuite/ *

Re: [PATCH] Detect loops in find_comparison_args

2012-07-25 Thread Paolo Bonzini
Il 24/07/2012 22:17, Sandra Loosemore ha scritto: I was looking to see what needs to be done to un-stick this previously submitted patch: http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01419.html Paolo's suggestion was to re-write this to use a tortoise-and-hare algorithm to detect the

Re: [PATCH] Detect loops in find_comparison_args

2012-07-25 Thread Sandra Loosemore
On 07/25/2012 01:27 AM, Paolo Bonzini wrote: What I'm worried about is the extra cost of malloc-ing and free-ing the pointer set. Perhaps you can skip the pointer set creation in the common case where find_comparison_args does not iterate? Something like this: [snip] I think this

Re: [PATCH] Detect loops in find_comparison_args

2012-07-24 Thread Sandra Loosemore
I was looking to see what needs to be done to un-stick this previously submitted patch: http://gcc.gnu.org/ml/gcc-patches/2012-05/msg01419.html Paolo's suggestion was to re-write this to use a tortoise-and-hare algorithm to detect the circularity, rather than Andrew's solution of using a

Re: [PATCH] Detect loops in find_comparison_args

2012-05-22 Thread Paolo Bonzini
Il 21/05/2012 19:21, Andrew Jenner ha scritto: 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

[PATCH] Detect loops in find_comparison_args

2012-05-21 Thread Andrew Jenner
This patch is a followup to the patch Sandra Loosemore made to fix PR50380 (see (http://gcc.gnu.org/ml/gcc-patches/2011-12/msg01402.html). That patch only detects fixed points, but Joseph Myers found a testcase which creates a cycle of length 2, causing find_comparison_args to stall even with

Re: [PATCH] Detect loops in find_comparison_args

2012-05-21 Thread Paolo Bonzini
Il 21/05/2012 17:54, Andrew Jenner ha scritto: This patch is a followup to the patch Sandra Loosemore made to fix PR50380 (see (http://gcc.gnu.org/ml/gcc-patches/2011-12/msg01402.html). That patch only detects fixed points, but Joseph Myers found a testcase which creates a cycle of length 2,

Re: [PATCH] Detect loops in find_comparison_args

2012-05-21 Thread Andrew Jenner
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