diff mbox

[match-and-simplify] Fix bootstrap

Message ID alpine.LSU.2.11.1407151146590.19154@zhemvz.fhfr.qr
State New
Headers show

Commit Message

Richard Biener July 15, 2014, 9:47 a.m. UTC
GENERIC code-path checking TREE_SIDE_EFFECTS ICEs on NULL ops
(obviously).  Guard against that.

Bootstrapped on x86_64-unknown-linux-gnu, applied.

Richard.

2014-07-15  Richard Biener  <rguenther@suse.de>

	* genmatch.c (decision_tree::gen_generic): Guard against
	NULL_TREE operands.
diff mbox

Patch

Index: genmatch.c
===================================================================
--- genmatch.c	(revision 212545)
+++ genmatch.c	(working copy)
@@ -1614,9 +1614,9 @@  decision_tree::gen_generic (FILE *f)
 	 principle we can do that automagically for a subset of
 	 transforms (and only reject the remaining cases).
 	 This fixes for example gcc.c-torture/execute/20050131-1.c.  */
-      fprintf (f, "if (TREE_SIDE_EFFECTS (op0)");
+      fprintf (f, "if ((op0 && TREE_SIDE_EFFECTS (op0))");
       for (unsigned i = 1; i < n; ++i)
-	fprintf (f, "|| TREE_SIDE_EFFECTS (op%d)", i);
+	fprintf (f, "|| (op%d && TREE_SIDE_EFFECTS (op%d))", i, i);
       fprintf (f, ")\n"
 	       "  return NULL_TREE;\n");