PR/56490
authorXinliang David Li <davidxl@google.com>
Sat, 2 Mar 2013 18:42:26 +0000 (18:42 +0000)
committerXinliang David Li <davidxl@gcc.gnu.org>
Sat, 2 Mar 2013 18:42:26 +0000 (18:42 +0000)
From-SVN: r196406

gcc/ChangeLog
gcc/tree-ssa-uninit.c

index fa0bb7655d0948100e2c7b56b7951034501c516e..32f6e4b6f0fe55f1288e16b6cd8b1d7b5ff89643 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-01  Xinliang David Li  <davidxl@google.com>
+
+       * tree-ssa-uninit.c (compute_control_dep_chain): Limit post-dom
+       walk length.
+
 2013-03-01  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/56461
index a91ee379d696bf07553180e52faadb37ce6248af..e8f3ff7e7302fef5652d89e58f1618be672e8293 100644 (file)
@@ -229,6 +229,7 @@ find_control_equiv_block (basic_block bb)
 
 #define MAX_NUM_CHAINS 8
 #define MAX_CHAIN_LEN 5
+#define MAX_POSTDOM_CHECK 8
 
 /* Computes the control dependence chains (paths of edges)
    for DEP_BB up to the dominating basic block BB (the head node of a
@@ -269,6 +270,7 @@ compute_control_dep_chain (basic_block bb, basic_block dep_bb,
   FOR_EACH_EDGE (e, ei, bb->succs)
     {
       basic_block cd_bb;
+      int post_dom_check = 0;
       if (e->flags & (EDGE_FAKE | EDGE_ABNORMAL))
         continue;
 
@@ -298,7 +300,8 @@ compute_control_dep_chain (basic_block bb, basic_block dep_bb,
             }
 
           cd_bb = find_pdom (cd_bb);
-          if (cd_bb == EXIT_BLOCK_PTR)
+          post_dom_check++;
+          if (cd_bb == EXIT_BLOCK_PTR || post_dom_check > MAX_POSTDOM_CHECK)
             break;
         }
       cur_cd_chain->pop ();