Patchwork Fix cselib dump ICE

login
register
mail settings
Submitter Jakub Jelinek
Date Feb. 13, 2012, 7:43 p.m.
Message ID <20120213194353.GM18768@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/140966/
State New
Headers show

Comments

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
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

--- 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));