2014-02-06 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Feb 2014 09:41:44 +0000 (09:41 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 6 Feb 2014 09:41:44 +0000 (09:41 +0000)
* tree-cfg.c (gimple_duplicate_sese_region): Fix ordering of
set_loop_copy and initialize_original_copy_tables.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207532 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-cfg.c

index 8181db7..b514a28 100644 (file)
@@ -1,3 +1,8 @@
+2014-02-06  Richard Biener  <rguenther@suse.de>
+
+       * tree-cfg.c (gimple_duplicate_sese_region): Fix ordering of
+       set_loop_copy and initialize_original_copy_tables.
+
 2014-02-06  Alex Velenko  <Alex.Velenko@arm.com>
 
        * config/aarch64/aarch64-simd.md
index dfc9b7b..3f17e14 100644 (file)
@@ -5879,14 +5879,11 @@ gimple_duplicate_sese_region (edge entry, edge exit,
        return false;
     }
 
-  set_loop_copy (loop, loop);
-
   /* In case the function is used for loop header copying (which is the primary
      use), ensure that EXIT and its copy will be new latch and entry edges.  */
   if (loop->header == entry->dest)
     {
       copying_header = true;
-      set_loop_copy (loop, loop_outer (loop));
 
       if (!dominated_by_p (CDI_DOMINATORS, loop->latch, exit->src))
        return false;
@@ -5897,14 +5894,19 @@ gimple_duplicate_sese_region (edge entry, edge exit,
          return false;
     }
 
+  initialize_original_copy_tables ();
+
+  if (copying_header)
+    set_loop_copy (loop, loop_outer (loop));
+  else
+    set_loop_copy (loop, loop);
+
   if (!region_copy)
     {
       region_copy = XNEWVEC (basic_block, n_region);
       free_region_copy = true;
     }
 
-  initialize_original_copy_tables ();
-
   /* Record blocks outside the region that are dominated by something
      inside.  */
   if (update_dominance)