re PR tree-optimization/32821 (tree-if-conv:combine_blocks with -ftree-dump-tree...
authorUros Bizjak <uros@gcc.gnu.org>
Fri, 7 Sep 2007 10:17:46 +0000 (12:17 +0200)
committerUros Bizjak <uros@gcc.gnu.org>
Fri, 7 Sep 2007 10:17:46 +0000 (12:17 +0200)
PR tree-optimization/32821
* tree_if_conv.c (combine_blocks): Use alloc_stmt_list instead of
NULL in the call to set_bb_stmt_list.

testsuite/ChangeLog:

PR tree-optimization/32821
* gcc.dg/tree-ssa/pr32821.c: New file.

From-SVN: r128235

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/pr32821.c [new file with mode: 0644]
gcc/tree-if-conv.c

index e5a2363..7ae6007 100644 (file)
@@ -1,3 +1,10 @@
+2007-09-07  Richard Guenther  <rguenther@suse.de>
+           Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/32821
+       * tree_if_conv.c (combine_blocks): Use alloc_stmt_list instead of
+       NULL in the call to set_bb_stmt_list.
+
 2007-09-07  Richard Sandiford  <richard@codesourcery.com>
 
        * config/mips/mips.c (build_mips16_call_stub): Emit all direct
index 0781fb1..c9dc15f 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-07 Uros Bizjak <ubizjak@gmail.com>
+
+       PR tree-optimization/32821
+       * gcc.dg/tree-ssa/pr32821.c: New file.
+
 2007-09-07  Richard Sandiford  <richard@codesourcery.com>
 
        * gcc.dg/attr-alias-3.c: Use real asm for MIPS.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr32821.c b/gcc/testsuite/gcc.dg/tree-ssa/pr32821.c
new file mode 100644 (file)
index 0000000..2195739
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-ifcvt-details" } */
+
+void
+main1 (int *arr, int n, int a, int b)
+{
+  int i;
+  for (i = 0; i < n; i++)
+    {
+      int m = arr[i];
+      arr[i] = (m < a ? m - a : b);
+    }
+}
+
+/* { dg-final { cleanup-tree-dump "ifcvt" } } */
index 289da6e..f97c23d 100644 (file)
@@ -985,7 +985,7 @@ combine_blocks (struct loop *loop)
       /* Update stmt list.  */
       last = tsi_last (bb_stmt_list (merge_target_bb));
       tsi_link_after (&last, bb_stmt_list (bb), TSI_NEW_STMT);
-      set_bb_stmt_list (bb, NULL);
+      set_bb_stmt_list (bb, alloc_stmt_list());
 
       delete_basic_block (bb);
     }