Ignore EDGE_{DFS_BACK,EXECUTABLE} in tail-merge
authorTom de Vries <tom@codesourcery.com>
Mon, 3 Jul 2017 07:23:01 +0000 (07:23 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Mon, 3 Jul 2017 07:23:01 +0000 (07:23 +0000)
2017-07-03  Tom de Vries  <tom@codesourcery.com>

PR tree-optimization/69468
* tree-ssa-tail-merge.c (ignore_edge_flags): New constant.
(find_same_succ_bb): Handle ignore_edge_flags.

* gcc.dg/pr81192.c: Update.

From-SVN: r249895

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr81192.c
gcc/tree-ssa-tail-merge.c

index 18f23c09f3166928696c155b3f75ba4e0a5bf721..c95a82fd351b7de5eb1d08e8f64d91761c02ad6a 100644 (file)
@@ -1,3 +1,9 @@
+2017-07-03  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/69468
+       * tree-ssa-tail-merge.c (ignore_edge_flags): New constant.
+       (find_same_succ_bb): Handle ignore_edge_flags.
+
 2017-07-03  Tom de Vries  <tom@codesourcery.com>
 
        PR tree-optimization/81192
index 12d441eb0109c1341944d23651769b9461654585..c52c7a838148856922a83f422c031473fb9a0da8 100644 (file)
@@ -1,3 +1,8 @@
+2017-07-03  Tom de Vries  <tom@codesourcery.com>
+
+       PR tree-optimization/69468
+       * gcc.dg/pr81192.c: Update.
+
 2017-07-03  Tom de Vries  <tom@codesourcery.com>
 
        PR tree-optimization/81192
index 8b3a77a60612b13374bb2792cdf4f8b739d6b0a3..57eb4781d4da1ac1c3aeb77b322ff1c36b0ddd57 100644 (file)
@@ -19,4 +19,4 @@ fn2 (void)
       ;
 }
 
-/* { dg-final { scan-tree-dump-not "(?n)find_duplicates: <bb .*> duplicate of <bb .*>" "pre" } } */
+/* { dg-final { scan-tree-dump-times "(?n)find_duplicates: <bb .*> duplicate of <bb .*>" 1 "pre" } } */
index 6fa4e5b2ad91805bd91c821f15f3242d38a93159..b11911b7f1e21b166f4156b9ebd3add0eb3689bd 100644 (file)
@@ -207,6 +207,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-eh.h"
 #include "tree-cfgcleanup.h"
 
+const int ignore_edge_flags = EDGE_DFS_BACK | EDGE_EXECUTABLE;
+
 /* Describes a group of bbs with the same successors.  The successor bbs are
    cached in succs, and the successor edge flags are cached in succ_flags.
    If a bb has the EDGE_TRUE/FALSE_VALUE flags swapped compared to succ_flags,
@@ -707,7 +709,7 @@ find_same_succ_bb (basic_block bb, same_succ **same_p)
     {
       int index = e->dest->index;
       bitmap_set_bit (same->succs, index);
-      same_succ_edge_flags[index] = e->flags;
+      same_succ_edge_flags[index] = (e->flags & ~ignore_edge_flags);
     }
   EXECUTE_IF_SET_IN_BITMAP (same->succs, 0, j, bj)
     same->succ_flags.safe_push (same_succ_edge_flags[j]);