cfganal.c (pre_and_rev_post_order_compute_fn): Correctly enter entry and exit blocks...
authorMichael Matz <matz@suse.de>
Mon, 31 Aug 2015 13:45:48 +0000 (13:45 +0000)
committerMichael Matz <matz@gcc.gnu.org>
Mon, 31 Aug 2015 13:45:48 +0000 (13:45 +0000)
* cfganal.c (pre_and_rev_post_order_compute_fn): Correctly
enter entry and exit blocks for reverse post order.

From-SVN: r227341

gcc/ChangeLog
gcc/cfganal.c

index deda8a42906789abec30c33ba12d07d6165a0652..7d48608e3e46119e8807eed435c64156da2b21ed 100644 (file)
@@ -1,3 +1,8 @@
+2015-08-31  Michael Matz  <matz@suse.de>
+
+       * cfganal.c (pre_and_rev_post_order_compute_fn): Correctly
+       enter entry and exit blocks for reverse post order.
+
 2015-08-31  Richard Biener  <rguenther@suse.de>
 
        * lto-streamer.h (lto_location_cache::cached_location::sysp): Add.
index 7676bd8d6ccaa1d8a4c19d0de5464eb29c6acaf6..3a9174c60bb397e9f7fc435edc21ca2726f8f166 100644 (file)
@@ -925,7 +925,7 @@ pre_and_rev_post_order_compute_fn (struct function *fn,
        pre_order[pre_order_num] = ENTRY_BLOCK;
       pre_order_num++;
       if (rev_post_order)
-       rev_post_order[rev_post_order_num--] = ENTRY_BLOCK;
+       rev_post_order[rev_post_order_num--] = EXIT_BLOCK;
     }
   else
     rev_post_order_num -= NUM_FIXED_BLOCKS;
@@ -996,7 +996,7 @@ pre_and_rev_post_order_compute_fn (struct function *fn,
        pre_order[pre_order_num] = EXIT_BLOCK;
       pre_order_num++;
       if (rev_post_order)
-       rev_post_order[rev_post_order_num--] = EXIT_BLOCK;
+       rev_post_order[rev_post_order_num--] = ENTRY_BLOCK;
     }
 
   return pre_order_num;