pred-1.C: New testcase
authorJan Hubicka <jh@suse.cz>
Fri, 3 Jun 2016 13:47:15 +0000 (15:47 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 3 Jun 2016 13:47:15 +0000 (13:47 +0000)
* g++.dg/tree-ssa/pred-1.C: New testcase
* gcc.dg/tree-ssa/pred-1.c: New testcase
* cp-gimplify.c (genericize_continue_stmt): Force addition of
predict stmt.

From-SVN: r237068

gcc/cp/ChangeLog
gcc/cp/cp-gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/tree-ssa/pred-1.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pred-1.c [new file with mode: 0644]

index fba9aa9e0485818fe5533bc38bd887bfda6ecd2f..69d3da17c9ece2ca26d3d10c0408d1ae29675ffe 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-02  Jan Hubicka  <jh@suse.cz>
+
+       * cp-gimplify.c (genericize_continue_stmt): Force addition of
+       predict stmt.
+
 2016-06-02  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * decl.c (xref_tag_1): Change pairs of errors to error + inform.
index 4fc8ba1afcacc379e89a2e6dbf5c477fa391b4b3..72ba50ee7230cb0eb91464ce848bd8e6d57e82f0 100644 (file)
@@ -362,7 +362,7 @@ genericize_continue_stmt (tree *stmt_p)
   tree label = get_bc_label (bc_continue);
   location_t location = EXPR_LOCATION (*stmt_p);
   tree jump = build1_loc (location, GOTO_EXPR, void_type_node, label);
-  append_to_statement_list (pred, &stmt_list);
+  append_to_statement_list_force (pred, &stmt_list);
   append_to_statement_list (jump, &stmt_list);
   *stmt_p = stmt_list;
 }
index 00e4ce6e721e0c928c4939e9972ef6f232f5584d..c567f75640803a12c8f87427173ebab1fb2e27c5 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-03  Jan Hubicka  <jh@suse.cz>
+
+       * g++.dg/tree-ssa/pred-1.C: New testcase
+       * gcc.dg/tree-ssa/pred-1.c: New testcase
+
 2016-06-03  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        PR target/70957
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pred-1.C b/gcc/testsuite/g++.dg/tree-ssa/pred-1.C
new file mode 100644 (file)
index 0000000..01b065e
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+int a[100];
+void foo(int);
+main()
+{
+  int i;
+  for (i=0;i<100;i++)
+    {
+      if (a[i])
+       continue;
+       foo(i);
+    }
+}
+// { dg-final { scan-tree-dump "continue heuristics" "profile_estimate" } }
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pred-1.c b/gcc/testsuite/gcc.dg/tree-ssa/pred-1.c
new file mode 100644 (file)
index 0000000..97e3cb7
--- /dev/null
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-profile_estimate" } */
+int a[100];
+void foo(int);
+int
+main()
+{
+  int i;
+  for (i=0;i<100;i++)
+    {
+      if (a[i])
+       continue;
+       foo(i);
+    }
+}
+// { dg-final { scan-tree-dump "continue heuristics" "profile_estimate" } }