PR 35736 -- use void_type_node for PREDICT_EXPR tree
authorMichael Meissner <gnu@the-meissners.org>
Thu, 3 Jul 2008 16:22:12 +0000 (16:22 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 3 Jul 2008 16:22:12 +0000 (16:22 +0000)
From-SVN: r137425

gcc/ChangeLog
gcc/predict.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr35736.c [new file with mode: 0644]

index 1bd9de68ce7e6a6a5349ee5baa30d417d6322eef..184ce612034fb3da7a13b68dcb99fdb3e2de9631 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2008-07-03  H.J. Lu  <hongjiu.lu@intel.com>
 
        * config/i386/i386.c (contains_aligned_value_p): Return true
index ad5e8eae23206ff79e1fa85a0f2ca163d41c4134..f85786e1a1d8f6da3cf922ab236452f623de2294 100644 (file)
@@ -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 35eb4b1567bc0d035033d0ff129a83654a9c74a6..bd58e5576e913491715bb9ee50c5746b39c574de 100644 (file)
@@ -1,3 +1,8 @@
+2008-07-03  Michael Meissner  <gnu@the-meissners.org>
+
+       PR middle-end/35736
+       * gcc.dg/pr35736.c: New file.
+
 2008-07-03  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * gcc.dg/pr28243.c: Skip on SPU.
diff --git a/gcc/testsuite/gcc.dg/pr35736.c b/gcc/testsuite/gcc.dg/pr35736.c
new file mode 100644 (file)
index 0000000..f411bb8
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile } */
+/* { dg-options "-O -Wall" } */
+
+void foo()
+{
+  while (1)
+    for (;;({ continue; }))
+      ;
+}