diff options
author | 2011-06-18 18:00:49 +0000 | |
---|---|---|
committer | 2011-06-18 18:00:49 +0000 | |
commit | 90635715df39cdf4b6a7c1e2c47be72bdf48dc0f (patch) | |
tree | d64261367bbcc6755b02009208812b177c8ebde4 /4.5.2 | |
parent | add fix from upstream for missing symbol versions in multilib builds #304239 (diff) | |
download | gcc-patches-90635715df39cdf4b6a7c1e2c47be72bdf48dc0f.tar.gz gcc-patches-90635715df39cdf4b6a7c1e2c47be72bdf48dc0f.tar.bz2 gcc-patches-90635715df39cdf4b6a7c1e2c47be72bdf48dc0f.zip |
apply fix from upstream for PR43603 #365045 by Dennis Schridde
Diffstat (limited to '4.5.2')
-rw-r--r-- | 4.5.2/gentoo/62_all_gcc-4.5-ia64-pr43603.patch | 301 | ||||
-rw-r--r-- | 4.5.2/gentoo/README.history | 1 |
2 files changed, 302 insertions, 0 deletions
diff --git a/4.5.2/gentoo/62_all_gcc-4.5-ia64-pr43603.patch b/4.5.2/gentoo/62_all_gcc-4.5-ia64-pr43603.patch new file mode 100644 index 0000000..5341a88 --- /dev/null +++ b/4.5.2/gentoo/62_all_gcc-4.5-ia64-pr43603.patch @@ -0,0 +1,301 @@ +http://gcc.gnu.org/PR43603 +http://bugs.gentoo.org/365045 + +munged a little from the actual svn revs to apply to gcc-4.5.2 + +2011-04-07 Andrey Belevantsev <abel@ispras.ru> + + Backport from mainline + 2010-12-07 Andrey Belevantsev <abel@ispras.ru> + PR target/43603 + * haifa-sched.c (sched_create_recovery_edges): Update + dominator info. + * sel-sched-ir.c (maybe_tidy_empty_bb): Update dominator info + after deleting an empty block. + (tidy_control_flow): Also verify dominators. + (sel_remove_bb): Update dominator info after removing a block. + (sel_redirect_edge_and_branch_force): Assert that no unreachable + blocks will be created. Update dominator info. + (sel_redirect_edge_and_branch): Update dominator info when + basic blocks do not become unreachable. + (sel_remove_loop_preheader): Update dominator info. + + 2010-10-14 Andrey Belevantsev <abel@ispras.ru> + + * sel-sched-ir.c (maybe_tidy_empty_bb): Simplify comment. + (tidy_control_flow): Tidy vertical space. + (sel_remove_bb): New variable idx. Use it to remember the basic + block index before deleting the block. + (sel_remove_empty_bb): Remove dead code, simplify and insert to ... + (sel_merge_blocks): ... here. + * sel-sched-ir.h (sel_remove_empty_bb): Remove prototype. + +--- branches/gcc-4_5-branch/gcc/haifa-sched.c 2011/04/07 06:58:29 172083 ++++ branches/gcc-4_5-branch/gcc/haifa-sched.c 2011/04/07 06:59:19 172084 +@@ -4442,6 +4442,8 @@ + edge_flags = 0; + + make_single_succ_edge (rec, second_bb, edge_flags); ++ if (dom_info_available_p (CDI_DOMINATORS)) ++ set_immediate_dominator (CDI_DOMINATORS, rec, first_bb); + } + + /* This function creates recovery code for INSN. If MUTATE_P is nonzero, +--- branches/gcc-4_5-branch/gcc/sel-sched-ir.c 2011/04/07 06:58:29 172083 ++++ branches/gcc-4_5-branch/gcc/sel-sched-ir.c 2011/04/07 06:59:19 172084 +@@ -152,6 +152,7 @@ + + static void move_bb_info (basic_block, basic_block); + static void remove_empty_bb (basic_block, bool); ++static void sel_merge_blocks (basic_block, basic_block); + static void sel_remove_loop_preheader (void); + static bool bb_has_removable_jump_to_p (basic_block, basic_block); + +@@ -3550,6 +3551,7 @@ + maybe_tidy_empty_bb (basic_block bb) + { + basic_block succ_bb, pred_bb; ++ VEC (basic_block, heap) *dom_bbs; + edge e; + edge_iterator ei; + bool rescan_p; +@@ -3585,6 +3587,7 @@ + succ_bb = single_succ (bb); + rescan_p = true; + pred_bb = NULL; ++ dom_bbs = NULL; + + /* Redirect all non-fallthru edges to the next bb. */ + while (rescan_p) +@@ -3586,6 +3589,12 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p) + + if (!(e->flags & EDGE_FALLTHRU)) + { ++ /* We will update dominators here only when we'll get ++ an unreachable block when redirecting, otherwise ++ sel_redirect_edge_and_branch will take care of it. */ ++ if (e->dest != bb ++ && single_pred_p (e->dest)) ++ VEC_safe_push (basic_block, heap, dom_bbs, e->dest); + recompute_toporder_p |= sel_redirect_edge_and_branch (e, succ_bb); + rescan_p = true; + break; +@@ -3623,13 +3633,11 @@ + } + } + +- /* If it is possible - merge BB with its predecessor. */ + if (can_merge_blocks_p (bb->prev_bb, bb)) + sel_merge_blocks (bb->prev_bb, bb); + else +- /* Otherwise this is a block without fallthru predecessor. +- Just delete it. */ + { ++ /* This is a block without fallthru predecessor. Just delete it. */ + gcc_assert (pred_bb != NULL); + + if (in_current_region_p (pred_bb)) +@@ -3607,11 +3614,19 @@ maybe_tidy_empty_bb (basic_block bb, bool recompute_toporder_p) + remove_empty_bb (bb, true); + } + ++ if (!VEC_empty (basic_block, dom_bbs)) ++ { ++ VEC_safe_push (basic_block, heap, dom_bbs, succ_bb); ++ iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, false); ++ VEC_free (basic_block, heap, dom_bbs); ++ } ++ + if (recompute_toporder_p) + sel_recompute_toporder (); + + #ifdef ENABLE_CHECKING + verify_backedges (); ++ verify_dominators (CDI_DOMINATORS); + #endif + + return true; +@@ -5047,16 +5064,23 @@ + static void + sel_remove_bb (basic_block bb, bool remove_from_cfg_p) + { ++ unsigned idx = bb->index; ++ + gcc_assert (bb != NULL && BB_NOTE_LIST (bb) == NULL_RTX); + + remove_bb_from_region (bb); + return_bb_to_pool (bb); +- bitmap_clear_bit (blocks_to_reschedule, bb->index); ++ bitmap_clear_bit (blocks_to_reschedule, idx); + + if (remove_from_cfg_p) +- delete_and_free_basic_block (bb); ++ { ++ basic_block succ = single_succ (bb); ++ delete_and_free_basic_block (bb); ++ set_immediate_dominator (CDI_DOMINATORS, succ, ++ recompute_dominator (CDI_DOMINATORS, succ)); ++ } + +- rgn_setup_region (CONTAINING_RGN (bb->index)); ++ rgn_setup_region (CONTAINING_RGN (idx)); + } + + /* Concatenate info of EMPTY_BB to info of MERGE_BB. */ +@@ -5071,50 +5095,6 @@ + + } + +-/* Remove an empty basic block EMPTY_BB. When MERGE_UP_P is true, we put +- EMPTY_BB's note lists into its predecessor instead of putting them +- into the successor. When REMOVE_FROM_CFG_P is true, also remove +- the empty block. */ +-void +-sel_remove_empty_bb (basic_block empty_bb, bool merge_up_p, +- bool remove_from_cfg_p) +-{ +- basic_block merge_bb; +- +- gcc_assert (sel_bb_empty_p (empty_bb)); +- +- if (merge_up_p) +- { +- merge_bb = empty_bb->prev_bb; +- gcc_assert (EDGE_COUNT (empty_bb->preds) == 1 +- && EDGE_PRED (empty_bb, 0)->src == merge_bb); +- } +- else +- { +- edge e; +- edge_iterator ei; +- +- merge_bb = bb_next_bb (empty_bb); +- +- /* Redirect incoming edges (except fallthrough one) of EMPTY_BB to its +- successor block. */ +- for (ei = ei_start (empty_bb->preds); +- (e = ei_safe_edge (ei)); ) +- { +- if (! (e->flags & EDGE_FALLTHRU)) +- sel_redirect_edge_and_branch (e, merge_bb); +- else +- ei_next (&ei); +- } +- +- gcc_assert (EDGE_COUNT (empty_bb->succs) == 1 +- && EDGE_SUCC (empty_bb, 0)->dest == merge_bb); +- } +- +- move_bb_info (merge_bb, empty_bb); +- remove_empty_bb (empty_bb, remove_from_cfg_p); +-} +- + /* Remove EMPTY_BB. If REMOVE_FROM_CFG_P is false, remove EMPTY_BB from + region, but keep it in CFG. */ + static void +@@ -5414,12 +5394,16 @@ + } + + /* Merge basic block B into basic block A. */ +-void ++static void + sel_merge_blocks (basic_block a, basic_block b) + { +- sel_remove_empty_bb (b, true, false); +- merge_blocks (a, b); ++ gcc_assert (sel_bb_empty_p (b) ++ && EDGE_COUNT (b->preds) == 1 ++ && EDGE_PRED (b, 0)->src == b->prev_bb); + ++ move_bb_info (b->prev_bb, b); ++ remove_empty_bb (b, false); ++ merge_blocks (a, b); + change_loops_latches (b, a); + } + +@@ -5429,12 +5413,15 @@ + void + sel_redirect_edge_and_branch_force (edge e, basic_block to) + { +- basic_block jump_bb, src; ++ basic_block jump_bb, src, orig_dest = e->dest; + int prev_max_uid; + rtx jump; + +- gcc_assert (!sel_bb_empty_p (e->src)); +- ++ /* This function is now used only for bookkeeping code creation, where ++ we'll never get the single pred of orig_dest block and thus will not ++ hit unreachable blocks when updating dominator info. */ ++ gcc_assert (!sel_bb_empty_p (e->src) ++ && !single_pred_p (orig_dest)); + src = e->src; + prev_max_uid = get_max_uid (); + jump_bb = redirect_edge_and_branch_force (e, to); +@@ -5451,6 +5438,10 @@ + jump = find_new_jump (src, jump_bb, prev_max_uid); + if (jump) + sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP); ++ set_immediate_dominator (CDI_DOMINATORS, to, ++ recompute_dominator (CDI_DOMINATORS, to)); ++ set_immediate_dominator (CDI_DOMINATORS, orig_dest, ++ recompute_dominator (CDI_DOMINATORS, orig_dest)); + } + + /* A wrapper for redirect_edge_and_branch. Return TRUE if blocks connected by +@@ -5459,11 +5450,12 @@ + sel_redirect_edge_and_branch (edge e, basic_block to) + { + bool latch_edge_p; +- basic_block src; ++ basic_block src, orig_dest = e->dest; + int prev_max_uid; + rtx jump; + edge redirected; + bool recompute_toporder_p = false; ++ bool maybe_unreachable = single_pred_p (orig_dest); + + latch_edge_p = (pipelining_p + && current_loop_nest +@@ -5494,6 +5486,15 @@ + if (jump) + sel_init_new_insn (jump, INSN_INIT_TODO_LUID | INSN_INIT_TODO_SIMPLEJUMP); + ++ /* Only update dominator info when we don't have unreachable blocks. ++ Otherwise we'll update in maybe_tidy_empty_bb. */ ++ if (!maybe_unreachable) ++ { ++ set_immediate_dominator (CDI_DOMINATORS, to, ++ recompute_dominator (CDI_DOMINATORS, to)); ++ set_immediate_dominator (CDI_DOMINATORS, orig_dest, ++ recompute_dominator (CDI_DOMINATORS, orig_dest)); ++ } + return recompute_toporder_p; + } + +@@ -6220,6 +6221,10 @@ + if (BB_END (prev_bb) == bb_note (prev_bb)) + free_data_sets (prev_bb); + } ++ ++ set_immediate_dominator (CDI_DOMINATORS, next_bb, ++ recompute_dominator (CDI_DOMINATORS, ++ next_bb)); + } + } + VEC_free (basic_block, heap, preheader_blocks); +--- branches/gcc-4_5-branch/gcc/sel-sched-ir.h 2011/04/07 06:58:29 172083 ++++ branches/gcc-4_5-branch/gcc/sel-sched-ir.h 2011/04/07 06:59:19 172084 +@@ -1617,11 +1617,9 @@ + extern bool tidy_control_flow (basic_block, bool); + extern void free_bb_note_pool (void); + +-extern void sel_remove_empty_bb (basic_block, bool, bool); + extern void purge_empty_blocks (void); + extern basic_block sel_split_edge (edge); + extern basic_block sel_create_recovery_block (insn_t); +-extern void sel_merge_blocks (basic_block, basic_block); + extern bool sel_redirect_edge_and_branch (edge, basic_block); + extern void sel_redirect_edge_and_branch_force (edge, basic_block); + extern void sel_init_pipelining (void); + diff --git a/4.5.2/gentoo/README.history b/4.5.2/gentoo/README.history index f27e7fb..4875372 100644 --- a/4.5.2/gentoo/README.history +++ b/4.5.2/gentoo/README.history @@ -2,6 +2,7 @@ + 24_all_4.5.2_pr43653_clang_ICE.patch + 30_all_gcc-4.5-ppc-msingle-pic-base.patch + 31_all_gcc-4.4-ppc-fpic-mrelocatable.patch + + 62_all_gcc-4.5-ia64-pr43603.patch 1.1 13.02.2011 + 22_all_4.6_pr45094_arm-dword-move.patch |