re PR ipa/63196 (FAIL: g++.dg/torture/pr57140.C -O3 -fomit-frame-pointer (internal...
authorRichard Biener <rguenther@suse.de>
Mon, 8 Sep 2014 14:28:51 +0000 (14:28 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 8 Sep 2014 14:28:51 +0000 (14:28 +0000)
2014-09-08  Richard Biener  <rguenther@suse.de>

PR ipa/63196
* tree-inline.c (copy_loops): The source loop header should
always be non-NULL.
(tree_function_versioning): If loops need fixup after removing
unreachable blocks fix them.
* omp-low.c (simd_clone_adjust): Do not add incr block to
loop under construction.

From-SVN: r215016

gcc/ChangeLog
gcc/omp-low.c
gcc/tree-inline.c

index 9f4ac8b9260bde7083f4ae0e16961d0a5d9f7bdf..6137b1a4b6792755801809da9780ecb41d1aac42 100644 (file)
@@ -1,3 +1,13 @@
+2014-09-08  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/63196
+       * tree-inline.c (copy_loops): The source loop header should
+       always be non-NULL.
+       (tree_function_versioning): If loops need fixup after removing
+       unreachable blocks fix them.
+       * omp-low.c (simd_clone_adjust): Do not add incr block to
+       loop under construction.
+
 2014-09-08  Alan Lawrence  <alan.lawrence@arm.com>
 
        * config/aarch64/aarch64-builtins.c
index 22a8fcab57fa390efd9be9d56e398e8b9b9fbebc..be882f72628f09cfb36e36e82c90189e70a02860 100644 (file)
@@ -11900,6 +11900,7 @@ simd_clone_adjust (struct cgraph_node *node)
      iteration increment and the condition/branch.  */
   basic_block orig_exit = EDGE_PRED (EXIT_BLOCK_PTR_FOR_FN (cfun), 0)->src;
   basic_block incr_bb = create_empty_bb (orig_exit);
+  add_bb_to_loop (incr_bb, body_bb->loop_father);
   /* The succ of orig_exit was EXIT_BLOCK_PTR_FOR_FN (cfun), with an empty
      flag.  Set it now to be a FALLTHRU_EDGE.  */
   gcc_assert (EDGE_COUNT (orig_exit->succs) == 1);
@@ -11924,7 +11925,6 @@ simd_clone_adjust (struct cgraph_node *node)
   loop->safelen = node->simdclone->simdlen;
   loop->force_vectorize = true;
   loop->header = body_bb;
-  add_bb_to_loop (incr_bb, loop);
 
   /* Branch around the body if the mask applies.  */
   if (node->simdclone->inbranch)
@@ -11965,7 +11965,7 @@ simd_clone_adjust (struct cgraph_node *node)
   gsi_insert_after (&gsi, g, GSI_CONTINUE_LINKING);
   e = split_block (incr_bb, gsi_stmt (gsi));
   basic_block latch_bb = e->dest;
-  basic_block new_exit_bb = e->dest;
+  basic_block new_exit_bb;
   new_exit_bb = split_block (latch_bb, NULL)->dest;
   loop->latch = latch_bb;
 
index b82a1471f452a200ada0e3781b69bfa8cb7a11e2..ad474a586046d46e71dd724d80058f28f3a143f0 100644 (file)
@@ -2376,11 +2376,8 @@ copy_loops (copy_body_data *id,
 
          /* Assign the new loop its header and latch and associate
             those with the new loop.  */
-         if (src_loop->header != NULL)
-           {
-             dest_loop->header = (basic_block)src_loop->header->aux;
-             dest_loop->header->loop_father = dest_loop;
-           }
+         dest_loop->header = (basic_block)src_loop->header->aux;
+         dest_loop->header->loop_father = dest_loop;
          if (src_loop->latch != NULL)
            {
              dest_loop->latch = (basic_block)src_loop->latch->aux;
@@ -5536,6 +5533,11 @@ tree_function_versioning (tree old_decl, tree new_decl,
   delete_unreachable_blocks_update_callgraph (&id);
   if (id.dst_node->definition)
     cgraph_edge::rebuild_references ();
+  if (loops_state_satisfies_p (LOOPS_NEED_FIXUP))
+    {
+      calculate_dominance_info (CDI_DOMINATORS);
+      fix_loop_structure (NULL);
+    }
   update_ssa (TODO_update_ssa);
 
   /* After partial cloning we need to rescale frequencies, so they are