[PATCH, committed] PR middle-end/35736 -- make PREDICT_EXPR have void type

Michael Meissner gnu@the-meissners.org
Thu Jul 3 16:47:00 GMT 2008


I committed the following patch to fix PR 35736 after doing a full bootstrap
and make check-gcc without regressions.  It looks like PREDICT_EXPR was the
only tree type created without a valid type node.

[gcc]
2008-07-03  Michael Meissner  <gnu@the-meissners.org>

	PR middle-end/35736
	* predict.c (build_predict_expr): Use void_type_node for the tree
	type, instead of NULL_TREE.

[gcc/testsuite]
2008-07-03  Michael Meissner  <gnu@the-meissners.org>

	PR middle-end/35736
	* gcc.dg/pr35736.c: New file.

Index: gcc/predict.c
===================================================================
--- gcc/predict.c	(revision 137424)
+++ gcc/predict.c	(working copy)
@@ -1944,7 +1944,8 @@ gate_estimate_probability (void)
 tree
 build_predict_expr (enum br_predictor predictor, enum prediction taken)
 {
-  tree t = build1 (PREDICT_EXPR, NULL_TREE, build_int_cst (NULL, predictor));
+  tree t = build1 (PREDICT_EXPR, void_type_node,
+		   build_int_cst (NULL, predictor));
   PREDICT_EXPR_OUTCOME (t) = taken;
   return t;
 }
Index: gcc/testsuite/gcc.dg/pr35736.c
===================================================================
--- gcc/testsuite/gcc.dg/pr35736.c	(revision 0)
+++ gcc/testsuite/gcc.dg/pr35736.c	(revision 0)
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void foo()
+{
+  while (1)
+    for (;;({ continue; }))
+      ;
+}


-- 
Michael Meissner
email: gnu@the-meissners.org
http://www.the-meissners.org



More information about the Gcc-patches mailing list