Fix cselib dump ICE

Submitted by Jakub Jelinek on Feb. 13, 2012, 7:43 p.m.

Details

Message ID 20120213194353.GM18768@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek Feb. 13, 2012, 7:43 p.m.
Hi!

While debugging PR52172, I've noticed ICE when dumping RTL, all of
cselib seems to test setting_insn for NULL, but this spot doesn't.

Ok for trunk?

2012-02-13  Jakub Jelinek  <jakub@redhat.com>

	* cselib.c (dump_cselib_val): Don't assume l->setting_insn is
	non-NULL.


	Jakub

Comments

Richard Henderson Feb. 13, 2012, 8:04 p.m.
On 02/13/2012 11:43 AM, Jakub Jelinek wrote:
> 	* cselib.c (dump_cselib_val): Don't assume l->setting_insn is
> 	non-NULL.

Ok.

r~

Patch hide | download patch | download mbox

--- gcc/cselib.c.jj	2012-01-26 09:22:21.000000000 +0100
+++ gcc/cselib.c	2012-02-13 11:07:15.109023769 +0100
@@ -2688,8 +2688,11 @@  dump_cselib_val (void **x, void *info)
       fputs (" locs:", out);
       do
 	{
-	  fprintf (out, "\n  from insn %i ",
-		   INSN_UID (l->setting_insn));
+	  if (l->setting_insn)
+	    fprintf (out, "\n  from insn %i ",
+		     INSN_UID (l->setting_insn));
+	  else
+	    fprintf (out, "\n   ");
 	  print_inline_rtx (out, l->loc, 4);
 	}
       while ((l = l->next));