]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR bootstrap/65060 (r220696 breaks bootstrap on Linux/x86-32)
authorJeff Law <law@redhat.com>
Fri, 13 Feb 2015 23:53:54 +0000 (16:53 -0700)
committerJeff Law <law@gcc.gnu.org>
Fri, 13 Feb 2015 23:53:54 +0000 (16:53 -0700)
       PR bootstrap/65060
        Revert my change for tree-optimization/64823.

From-SVN: r220701

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/uninit-20.c [deleted file]
gcc/tree-ssa-threadedge.c
gcc/tree-vrp.c

index 0795bc6409bbb24b21e9cbdf0c6f93a4cbd4ed5f..ca43bfd0b94d897a7824d16ebbb5352b52047f5d 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-13  Jeff Law  <law@redhat.com>
+
+       PR bootstrap/65060
+       Revert my change for tree-optimization/64823.
+
 2015-02-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/65053
index f25e959ae2558988c49fc7a73ec401d268b36be2..bb13dc15523ecf2d6a4bb2bd72cf48d76b90d0d5 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-13  Jeff Law  <law@redhat.com>
+
+       PR bootstrap/65060
+       Revert my change for tree-optimization/64823.
+
 2015-02-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/65053
diff --git a/gcc/testsuite/gcc.dg/uninit-20.c b/gcc/testsuite/gcc.dg/uninit-20.c
deleted file mode 100644 (file)
index 12001ae..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Spurious uninitialized variable warnings, from gdb */
-/* { dg-do compile } */
-/* { dg-options "-O2 -Wuninitialized" } */
-struct os { struct o *o; };
-struct o { struct o *next; struct os *se; };
-void f(struct o *o){
-  struct os *s;
-  if(o) s = o->se;
-  while(o && s == o->se){
-    s++; // here `o' is non-zero and thus s is initialized
-    s == o->se  // `?' is essential, `if' does not trigger the warning
-      ? (o = o->next, o ? s = o->se : 0)
-      : 0;
-  }
-}
-
-
-
index 7187d065e91479aef5a1cbf7175ef76a4a4aa73a..4f839910a84c686644c59daf3c2b63e74250eeb1 100644 (file)
@@ -110,15 +110,6 @@ potentially_threadable_block (basic_block bb)
 {
   gimple_stmt_iterator gsi;
 
-  /* Special case.  We can get blocks that are forwarders, but are
-     not optimized away because they forward from outside a loop
-     to the loop header.   We want to thread through them as we can
-     sometimes thread to the loop exit, which is obviously profitable. 
-     the interesting case here is when the block has PHIs.  */
-  if (gsi_end_p (gsi_start_nondebug_bb (bb))
-      && !gsi_end_p (gsi_start_phis (bb)))
-    return true;
-  
   /* If BB has a single successor or a single predecessor, then
      there is no threading opportunity.  */
   if (single_succ_p (bb) || single_pred_p (bb))
@@ -1290,32 +1281,16 @@ thread_through_normal_block (edge e,
     = record_temporary_equivalences_from_stmts_at_dest (e, stack, simplify,
                                                        *backedge_seen_p);
 
-  /* There's two reasons STMT might be null, and distinguishing
-     between them is important.
+  /* If we didn't look at all the statements, the most likely reason is
+     there were too many and thus duplicating this block is not profitable.
 
-     First the block may not have had any statements.  For example, it
-     might have some PHIs and unconditionally transfer control elsewhere.
-     Such blocks are suitable for jump threading, particularly as a
-     joiner block.
-
-     The second reason would be if we did not process all the statements
-     in the block (because there were too many to make duplicating the
-     block profitable.   If we did not look at all the statements, then
-     we may not have invalidated everything needing invalidation.  Thus
-     we must signal to our caller that this block is not suitable for
-     use as a joiner in a threading path.  */
+     Also note if we do not look at all the statements, then we may not
+     have invalidated equivalences that are no longer valid if we threaded
+     around a loop.  Thus we must signal to our caller that this block
+     is not suitable for use as a joiner in a threading path.  */
   if (!stmt)
-    {
-      /* First case.  The statement simply doesn't have any instructions, but
-        does have PHIs.  */
-      if (gsi_end_p (gsi_start_nondebug_bb (e->dest))
-         && !gsi_end_p (gsi_start_phis (e->dest)))
-       return 0;
+    return -1;
 
-      /* Second case.  */
-      return -1;
-    }
-  
   /* If we stopped at a COND_EXPR or SWITCH_EXPR, see if we know which arm
      will be taken.  */
   if (gimple_code (stmt) == GIMPLE_COND
index 7367684f4b41ee64564fd1256d969cb14b31de58..dad1830e9a1b98e111ea1b5b46fc71efe4cd27ef 100644 (file)
@@ -10181,15 +10181,8 @@ identify_jump_threads (void)
       /* We're basically looking for a switch or any kind of conditional with
         integral or pointer type arguments.  Note the type of the second
         argument will be the same as the first argument, so no need to
-        check it explicitly. 
-
-        We also handle the case where there are no statements in the
-        block.  This come up with forwarder blocks that are not
-        optimized away because they lead to a loop header.  But we do
-        want to thread through them as we can sometimes thread to the
-        loop exit which is obviously profitable.  */
-      if (!last
-         || gimple_code (last) == GIMPLE_SWITCH
+        check it explicitly.  */
+      if (gimple_code (last) == GIMPLE_SWITCH
          || (gimple_code (last) == GIMPLE_COND
              && TREE_CODE (gimple_cond_lhs (last)) == SSA_NAME
              && (INTEGRAL_TYPE_P (TREE_TYPE (gimple_cond_lhs (last)))