Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1316)

Unified Diff: cfgcleanup.c

Issue 6823047: [PATCH] Fix PR 53743 and other -freorder-blocks-and-partition failures Base URL: svn+ssh://gcc.gnu.org/svn/gcc/trunk/gcc/
Patch Set: Fix PR 53743 and other -freorder-blocks-and-partition failures Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bb-reorder.c ('k') | cfghooks.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cfgcleanup.c
===================================================================
--- cfgcleanup.c (revision 198686)
+++ cfgcleanup.c (working copy)
@@ -452,9 +452,11 @@ try_forward_edges (int mode, basic_block b)
really must be left untouched (they are required to make it safely
across partition boundaries). See the comments at the top of
bb-reorder.c:partition_hot_cold_basic_blocks for complete
- details. */
+ details. These forwarding blocks may be removed once we
+ leave CFGLAYOUT mode, however, and are done with bb layout. */
if (first != EXIT_BLOCK_PTR
+ && current_ir_type() != IR_RTL_CFGRTL
&& find_reg_note (BB_END (first), REG_CROSSING_JUMP, NULL_RTX))
return false;
@@ -465,7 +467,8 @@ try_forward_edges (int mode, basic_block b)
may_thread |= (target->flags & BB_MODIFIED) != 0;
if (FORWARDER_BLOCK_P (target)
- && !(single_succ_edge (target)->flags & EDGE_CROSSING)
+ && (!(single_succ_edge (target)->flags & EDGE_CROSSING)
+ || current_ir_type() == IR_RTL_CFGRTL)
&& single_succ (target) != EXIT_BLOCK_PTR)
{
/* Bypass trivial infinite loops. */
@@ -1864,7 +1867,7 @@ try_crossjump_to_edge (int mode, edge e1, edge e2,
partition boundaries). See the comments at the top of
bb-reorder.c:partition_hot_cold_basic_blocks for complete details. */
- if (flag_reorder_blocks_and_partition && reload_completed)
+ if (crtl->has_bb_partition && reload_completed)
return false;
/* Search backward through forwarder blocks. We don't need to worry
@@ -2807,10 +2810,21 @@ try_optimize_cfg (int mode)
df_analyze ();
}
+ if (changed)
+ {
+ /* Edge forwarding in particular can cause hot blocks previously
+ reached by both hot and cold blocks to become dominated only
+ by cold blocks. This will cause the verification below to fail,
+ and lead to now cold code in the hot section. This is not easy
+ to detect and fix during edge forwarding, and in some cases
+ is only visible after newly unreachable blocks are deleted,
+ which will be done in fixup_partitions. */
+ fixup_partitions ();
+
#ifdef ENABLE_CHECKING
- if (changed)
- verify_flow_info ();
+ verify_flow_info ();
#endif
+ }
changed_overall |= changed;
first_pass = false;
« no previous file with comments | « bb-reorder.c ('k') | cfghooks.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b