[Bug rtl-optimization/55158] [4.8 Regression] [IA64] ICE: segv in schedule_region

2012-12-01 Thread gary at intrepid dot com


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



--- Comment #10 from Gary Funck gary at intrepid dot com 2012-12-01 23:17:00 
UTC ---

(In reply to comment #9)

 OK, I applied it to our autotester and we will see tomorrow if it fixes the

 segfaults.

 If so, can I go ahead and commit it?

 

 Honza



Ping: was this patch tested and then applied?



thanks.


[Bug rtl-optimization/55158] [4.8 Regression] [IA64] ICE: segv in schedule_region

2012-11-09 Thread hubicka at gcc dot gnu.org


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



--- Comment #9 from Jan Hubicka hubicka at gcc dot gnu.org 2012-11-09 
16:38:16 UTC ---

OK, I applied it to our autotester and we will see tomorrow if it fixes the

segfaults.

If so, can I go ahead and commit it?



Honza


[Bug rtl-optimization/55158] [4.8 Regression] [IA64] ICE: segv in schedule_region

2012-11-09 Thread hubicka at gcc dot gnu.org


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



Jan Hubicka hubicka at gcc dot gnu.org changed:



   What|Removed |Added



 CC||hubicka at gcc dot gnu.org



--- Comment #6 from Jan Hubicka hubicka at gcc dot gnu.org 2012-11-09 
14:22:55 UTC ---

Hmm, this bug currently breaks half IA-64 bencharking in our autotester.

http://gcc.opensuse.org/ (terbium)



Bernd, you seem to be last who touched this area.  Does the patch look OK for

you?

(probably these structures should be turned into VECtors).



Honza


[Bug rtl-optimization/55158] [4.8 Regression] [IA64] ICE: segv in schedule_region

2012-11-09 Thread gary at intrepid dot com


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



--- Comment #8 from Gary Funck gary at intrepid dot com 2012-11-09 15:26:46 
UTC ---

(In reply to comment #5)

 Completely untested patch for someone else to foster-parent:



 +   }

 +   }

   f = find_fallthru_edge (last_bb-succs);

   if (f  f-probability * 100 / REG_BR_PROB_BASE =

   PARAM_VALUE (PARAM_SCHED_STATE_EDGE_PROB_CUTOFF))



I could not apply the patch cleanly.  Perhaps it was garbled by line wraps,

etc.  Can you post the patch as an attachment?


[Bug rtl-optimization/55158] [4.8 Regression] [IA64] ICE: segv in schedule_region

2012-11-07 Thread steven at gcc dot gnu.org


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



--- Comment #3 from Steven Bosscher steven at gcc dot gnu.org 2012-11-07 
20:57:49 UTC ---

(In reply to comment #1)

 The last basic block is 23, and the array bb_state[] is initialized only

 for entries 0..22.  Perhaps the number entries allocated should be

 (last_basic_block +  1) with the initialization loop adjusted

 accordingly?



Actually, last_basic_block is already largest bb index + 1. The name

is a bit confusing...


[Bug rtl-optimization/55158] [4.8 Regression] [IA64] ICE: segv in schedule_region

2012-11-07 Thread steven at gcc dot gnu.org


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



Steven Bosscher steven at gcc dot gnu.org changed:



   What|Removed |Added



 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-11-07

 Ever Confirmed|0   |1



--- Comment #4 from Steven Bosscher steven at gcc dot gnu.org 2012-11-07 
21:07:44 UTC ---

Confirmed.  The scheduler creates new basic blocks via generate_recovery_code,

leading to:



Breakpoint 5, schedule_region (rgn=0) at gcc/sched-rgn.c:2990

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

1: last_basic_block = 23

(gdb) 

Continuing.



Breakpoint 6, create_basic_block (...) at gcc/cfghooks.c:644

644   if (!cfg_hooks-create_basic_block)

1: last_basic_block = 23

(gdb) up

#1  0x... in create_empty_bb (..) at ../../trunk/gcc/cfghooks.c:662

662   return create_basic_block (NULL, NULL, after);

(gdb) 

#2  0x... in sched_create_empty_bb_1 (...) at gcc/haifa-sched.c:8479

8479  return create_empty_bb (after);

(gdb) 

#3  0x... in init_before_recovery (...) at gcc/haifa-sched.c:7491

7491  single = sched_create_empty_bb (last);

(gdb) 



But apparently some of the scheduler data structures are not resized.


[Bug rtl-optimization/55158] [4.8 Regression] [IA64] ICE: segv in schedule_region

2012-11-07 Thread steven at gcc dot gnu.org


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))