http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55158



--- Comment #5 from Steven Bosscher <steven at gcc dot gnu.org> 2012-11-07 
21:19:42 UTC ---

Completely untested patch for someone else to foster-parent:



--- sched-rgn.c 2012-11-04 14:48:19.110019609 -0800

+++ sched-rgn.c 2012-11-07 13:17:06.740019608 -0800

@@ -2986,10 +2986,23 @@

       if (dbg_cnt (sched_block))

         {

          edge f;

+         int saved_last_basic_block = last_basic_block;



           schedule_block (&curr_bb, bb_state[first_bb->index]);

           gcc_assert (EBB_FIRST_BB (bb) == first_bb);

           sched_rgn_n_insns += sched_n_insns;

+         if (last_basic_block > saved_last_basic_block)

+           {

+             /* New basic blocks have been created, probably for

+                speculation recovery code.  Fixup the state array.  */

+             bb_state_array = (char *) xrealloc (last_basic_block *

dfa_state_size);

+             bb_state = XRESIZEVEC (state_t, bb_state, last_basic_block);

+             for (int i = saved_last_basic_block; i < last_basic_block; i++)

+               {

+                 bb_state[i] = (state_t) (bb_state_array + i *

dfa_state_size);

+                 state_reset (bb_state[i]);

+               }

+           }

          f = find_fallthru_edge (last_bb->succs);

          if (f && f->probability * 100 / REG_BR_PROB_BASE >=

              PARAM_VALUE (PARAM_SCHED_STATE_EDGE_PROB_CUTOFF))

Reply via email to