[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-23 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

--- Comment #6 from Andrey Belevantsev abel at gcc dot gnu.org ---
Author: abel
Date: Mon Feb 24 05:57:02 2014
New Revision: 208066

URL: http://gcc.gnu.org/viewcvs?rev=208066root=gccview=rev
Log:
gcc/

2014-02-24  Andrey Belevantsev  a...@ispras.ru

PR rtl-optimization/60268
* sched-rgn.c (haifa_find_rgns): Move the nr_regions_initial variable
initialization to ...
(sched_rgn_init): ... here.
(schedule_region): Check for SCHED_PRESSURE_NONE earlier.

testsuite/

2014-02-24  Andrey Belevantsev  a...@ispras.ru

PR rtl-optimization/60268
* gcc.c-torture/compile/pr60268.c: New test.

Added:
trunk/gcc/testsuite/gcc.c-torture/compile/pr60268.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/sched-rgn.c
trunk/gcc/testsuite/ChangeLog


[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-23 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

Andrey Belevantsev abel at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #7 from Andrey Belevantsev abel at gcc dot gnu.org ---
Fixed on trunk.


[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-20 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

--- Comment #4 from Andrey Belevantsev abel at gcc dot gnu.org ---

(In reply to Jakub Jelinek from comment #2)

I forgot the single block regions case, so the nr_regions_initial init should
be moved to the bottom of sched_rgn_init.

The check before free_global_sched_pressure_data can be moved before if() like
in the below patch, this way we do not call it each time after we have reset
sched_pressure to NONE for the new regions, or I can drop it altogether, as you
prefer.

diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 0573b6a..dc6fa16 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -1067,7 +1067,6 @@ haifa_find_rgns (void)
BLOCK_TO_BB (bb-index) = 0;
   }

-  nr_regions_initial = nr_regions;
   free (max_hdr);
   free (degree);
   free (stack);
@@ -2997,10 +2996,10 @@ schedule_region (int rgn)

   /* Do not support register pressure sensitive scheduling for the new regions
  as we don't update the liveness info for them.  */
-  if (rgn = nr_regions_initial)
+  if (sched_pressure != SCHED_PRESSURE_NONE
+   rgn = nr_regions_initial)
 {
-  if (sched_pressure != SCHED_PRESSURE_NONE)
-   free_global_sched_pressure_data ();
+  free_global_sched_pressure_data ();
   sched_pressure = SCHED_PRESSURE_NONE;
 }

@@ -3166,6 +3165,7 @@ sched_rgn_init (bool single_blocks_p)

   RGN_BLOCKS (nr_regions) = (RGN_BLOCKS (nr_regions - 1) +
 RGN_NR_BLOCKS (nr_regions - 1));
+  nr_regions_initial = nr_regions;
 }

 /* Free data structures for region scheduling.  */


[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-20 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

--- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org ---
If this works, fine with me, but I'll defer the review to Vladimir.


[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-19 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

   Target Milestone|--- |4.9.0


[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-19 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

Andrey Belevantsev abel at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |abel at gcc dot gnu.org

--- Comment #3 from Andrey Belevantsev abel at gcc dot gnu.org ---
I'm out of office today, so I'll have a look properly tomorrow, but...

(In reply to Jakub Jelinek from comment #2)
 So perhaps:
 --- gcc/haifa-sched.c 2014-02-18 08:18:53.045024428 +0100
 +++ gcc/haifa-sched.c 2014-02-19 07:58:38.191381581 +0100
 @@ -2550,7 +2550,7 @@ rank_for_schedule (const void *x, const
   return INSN_LUID (tmp) - INSN_LUID (tmp2);
  }
  
 -  if (live_range_shrinkage_p)
 +  if (live_range_shrinkage_p  sched_pressure != SCHED_PRESSURE_NONE)
  {
/* Don't use SCHED_PRESSURE_MODEL -- it results in much worse
code.  */

...  the fired assert below this code means that we have turned off
sched-pressure on the new region (unexpectedly to live_range_shrinkage) and I'd
like to know how this region was added.  I guess I missed some entry point
within the new scheduler code when fixing the previous PR.

 
 BTW, why
   if (sched_pressure != SCHED_PRESSURE_NONE)
 free_global_sched_pressure_data ();
 when free_global_sched_pressure_data () contains the same guard and thus
 could be called unconditionally?

Pilot error while being over cautious, I will simplify that too.

[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-18 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-02-19
 CC||abel at gcc dot gnu.org,
   ||jakub at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org ---
Started with r207832.


[Bug rtl-optimization/60268] [4.9 regression] ICE: in rank_for_schedule, at haifa-sched.c:2557

2014-02-18 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60268

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||vmakarov at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org ---
So perhaps:
--- gcc/haifa-sched.c2014-02-18 08:18:53.045024428 +0100
+++ gcc/haifa-sched.c2014-02-19 07:58:38.191381581 +0100
@@ -2550,7 +2550,7 @@ rank_for_schedule (const void *x, const
 return INSN_LUID (tmp) - INSN_LUID (tmp2);
 }

-  if (live_range_shrinkage_p)
+  if (live_range_shrinkage_p  sched_pressure != SCHED_PRESSURE_NONE)
 {
   /* Don't use SCHED_PRESSURE_MODEL -- it results in much worse
  code.  */

BTW, why
  if (sched_pressure != SCHED_PRESSURE_NONE)
free_global_sched_pressure_data ();
when free_global_sched_pressure_data () contains the same guard and thus could
be called unconditionally?