From: tejohnson Date: Mon, 18 Nov 2013 22:38:51 +0000 (+0000) Subject: This patch fixes an lto profiledbootstrap failure with X-Git-Tag: upstream/4.9.2~2865 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e31c70b949be034408ba486bff4da6c260c87013;p=platform%2Fupstream%2Flinaro-gcc.git This patch fixes an lto profiledbootstrap failure with -freorder-blocks-and-partition enabled. Currently compgotos is the only pass that goes into cfglayout mode after bb reordering, which is undesireable (and in the case of -freorder-blocks-and-partition can cause illegal partitioning) because of the optimizations performed on the cfg when going into cfglayout mode. Moved compgoto before bb reordering to avoid these problems. 2013-11-18 Teresa Johnson * gcc/cfgrtl.c (cfg_layout_initialize): Assert if we try to go into cfglayout after bb reordering. * gcc/passes.def: Move compgotos before bb reordering since it goes into cfglayout. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204985 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 498f780..d49af50 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-11-18 Teresa Johnson + + * gcc/cfgrtl.c (cfg_layout_initialize): Assert if we + try to go into cfglayout after bb reordering. + * gcc/passes.def: Move compgotos before bb reordering + since it goes into cfglayout. + 2013-11-18 Bernd Schmidt * cgraphunit.c (ipa_passes): Don't execute all_lto_gen_passes. diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index c7ee7ee..1f99aa1 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -4204,6 +4204,15 @@ cfg_layout_initialize (unsigned int flags) rtx x; basic_block bb; + /* Once bb reordering is complete, cfg layout mode should not be re-entered. + Entering cfg layout mode will perform optimizations on the cfg that + could affect the bb layout negatively or even require fixups. An + example of the latter is if edge forwarding performed when optimizing + the cfg layout required moving a block from the hot to the cold section + under -freorder-blocks-and-partition. This would create an illegal + partitioning unless some manual fixup was performed. */ + gcc_assert (!crtl->bb_reorder_complete); + initialize_original_copy_tables (); cfg_layout_rtl_register_cfg_hooks (); diff --git a/gcc/passes.def b/gcc/passes.def index 8480991..0aba1d9 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -382,6 +382,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_regrename); NEXT_PASS (pass_cprop_hardreg); NEXT_PASS (pass_fast_rtl_dce); + NEXT_PASS (pass_duplicate_computed_gotos); NEXT_PASS (pass_reorder_blocks); NEXT_PASS (pass_branch_target_load_optimize2); NEXT_PASS (pass_leaf_regs); @@ -393,7 +394,6 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_stack_regs_run); POP_INSERT_PASSES () NEXT_PASS (pass_compute_alignments); - NEXT_PASS (pass_duplicate_computed_gotos); NEXT_PASS (pass_variable_tracking); NEXT_PASS (pass_free_cfg); NEXT_PASS (pass_machine_reorg);