Message ID | 50BF8ECF.4010804@redhat.com |
---|---|
State | New |
Headers | show |
On Wed, Dec 5, 2012 at 7:13 PM, Aldy Hernandez wrote: > This is a division by zero ICE. > > In the testcase in the PR, both `n' and `lra_live_max_point' are zero. I > have opted to inhibit the dump when lra_live_max_point is zero, but I can > just as easily avoiding printing the percentage in this case. Test case? Also, it'd be preferable if you can also update remove_some_program_points_and_update_live_ranges in ira-lives.c -- it seems to me that at some point we're going to want to merge the almost identical functions from LRA and IRA but that gets harder if they start diverging. > Let me know what you prefer. How can you end up with lra_live_max_point==0? AFAIU that can only happen if you have no live ranges at all (no program points) or if somehow the curr_point counter got messed up. The former case would mean you shouldn't end up calling remove_some_program_points_and_update_live_ranges to begin with (no program points being there to remove), the latter case would be a bug. I don't think this is the correct fix. Ciao! Steven
On 12-12-05 1:13 PM, Aldy Hernandez wrote: > This is a division by zero ICE. > > In the testcase in the PR, both `n' and `lra_live_max_point' are zero. > I have opted to inhibit the dump when lra_live_max_point is zero, but > I can just as easily avoiding printing the percentage in this case. > Interesting. I never thought that is possible. > Let me know what you prefer. > > OK for trunk? Yes, it is ok if you add the testcase for GCC testsuite. It would be nice if you add analogous code for ira-lives.c::remove_some_program_points_and_update_live_ranges too.
diff --git a/gcc/lra-lives.c b/gcc/lra-lives.c index c79b95b..46146ca 100644 --- a/gcc/lra-lives.c +++ b/gcc/lra-lives.c @@ -811,7 +811,7 @@ remove_some_program_points_and_update_live_ranges (void) sbitmap_free (born); sbitmap_free (dead); n++; - if (lra_dump_file != NULL) + if (lra_dump_file != NULL && lra_live_max_point) fprintf (lra_dump_file, "Compressing live ranges: from %d to %d - %d%%\n", lra_live_max_point, n, 100 * n / lra_live_max_point); if (n < lra_live_max_point)