public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PR rtl-optimization/55604]: fix ICE in remove_some_program_points_and_update_live_ranges
@ 2012-12-05 19:36 David Edelsohn
  0 siblings, 0 replies; 10+ messages in thread
From: David Edelsohn @ 2012-12-05 19:36 UTC (permalink / raw)
  To: Vladimir Makarov, Aldy Hernandez, Steven Bosscher; +Cc: GCC Patches

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.

I agree with Steven, this patch seems to be fixing the symptom, not
the problem.  Please re-consider if Steven's patch is a better
solution.

Thanks, David

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PR rtl-optimization/55604]: fix ICE in remove_some_program_points_and_update_live_ranges
@ 2012-12-05 18:13 Aldy Hernandez
  2012-12-05 18:25 ` Aldy Hernandez
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Aldy Hernandez @ 2012-12-05 18:13 UTC (permalink / raw)
  To: Vladimir N. Makarov; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

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.

Let me know what you prefer.

OK for trunk?

[-- Attachment #2: curr --]
[-- Type: text/plain, Size: 816 bytes --]

commit 6b366d44e7d30d3a24eda07fcb43fc20e2aa7102
Author: Aldy Hernandez <aldyh@redhat.com>
Date:   Wed Dec 5 12:06:01 2012 -0600

    	PR rtl-optimization/55604
    	* lra-lives.c
    	* (remove_some_program_points_and_update_live_ranges):
    	Avoiding division by zero when dumping live range compression.

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)

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-12-05 23:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-05 19:36 [PR rtl-optimization/55604]: fix ICE in remove_some_program_points_and_update_live_ranges David Edelsohn
  -- strict thread matches above, loose matches on Subject: below --
2012-12-05 18:13 Aldy Hernandez
2012-12-05 18:25 ` Aldy Hernandez
2012-12-05 18:26 ` Steven Bosscher
2012-12-05 18:48 ` Vladimir Makarov
2012-12-05 19:11   ` Steven Bosscher
2012-12-05 19:15     ` Steven Bosscher
2012-12-05 19:33     ` Vladimir Makarov
2012-12-05 20:47       ` Aldy Hernandez
2012-12-05 23:58         ` Steven Bosscher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).