[Bug rtl-optimization/60866] [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion

2014-05-14 Thread abel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60866

--- Comment #4 from Andrey Belevantsev abel at gcc dot gnu.org ---
Author: abel
Date: Wed May 14 12:09:02 2014
New Revision: 210420

URL: http://gcc.gnu.org/viewcvs?rev=210420root=gccview=rev
Log:
PR rtl-optimization/60866
* sel-sched-ir (sel_init_new_insn): New parameter old_seqno.
Default it to -1.  Pass it down to init_simplejump_data.
(init_simplejump_data): New parameter old_seqno.  Pass it down
to get_seqno_for_a_jump.
(get_seqno_for_a_jump): New parameter old_seqno.  Use it for
initializing new jump seqno as a last resort.  Add comment.
(sel_redirect_edge_and_branch): Save old seqno of the conditional
jump and pass it down to sel_init_new_insn.
(sel_redirect_edge_and_branch_force): Likewise.

* gcc.dg/pr60866.c: New test. 

Added:
trunk/gcc/testsuite/gcc.dg/pr60866.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/sel-sched-ir.c
trunk/gcc/testsuite/ChangeLog


[Bug rtl-optimization/60866] [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion

2014-05-14 Thread abel at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60866

Andrey Belevantsev abel at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
  Known to work||4.10.0
 Resolution|--- |FIXED
  Known to fail|4.10.0  |

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


[Bug rtl-optimization/60866] [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion

2014-04-28 Thread abel at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60866

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 ---
Created attachment 32692
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=32692action=edit
draft patch

An interesting case so I'd leave more detailed notes.  We are scheduling a
region that has a diamond like this:
  bb 3 --
|\
  bb 4\
 /\ \
   bb 5   bb 6  /
 \//
   bb 7  --

After scheduling bb 3 we proceed to bb 4 and bb 7 simultaneously.  Bbs 5 and 6
have identical insns.  While having a fence at the end of bb 4, we unify these
insns to one and get empty bbs 5 and 6 at once.  While simplifying this, we end
up with a conditional jump ending bb 4 turning into an unconditional one
leading to bb 7 (via redirect_edge_and_branch).  This jump is the new insn so
should be initialized.  We try to get a seqno for this jump from surrounding
unscheduled code (via get_seqno_for_a_jump), but both bbs 4 and 7 are already
completely scheduled.  Thus we ICE.

The only unscheduled insn in this region is the old conditional jump.  But it
is no longer with us while we're trying to init the new jump it turned into.  

The easy solution is to remove the assert and to change it into something like
seqno = 42;.  This fixes the test but we will never be able to catch bugs in
this function again.  The preferred solution will be to pass down the old jump
seqno to the initializing function so it would take it as the new jump seqno
only in this particular case.  That means changing a number of
sel_init_new_insn callers.  But, if we are now allowed to have default
parameters (do we?), this simplifies things.

Attached is the draft patch (the function comments is not yet updated, C++
default parameters are used).


[Bug rtl-optimization/60866] [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion

2014-04-17 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60866

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Target||x86_64-*-*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2014-04-17
   Target Milestone|--- |4.7.4
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener rguenth at gcc dot gnu.org ---
Confirmed.


[Bug rtl-optimization/60866] [4.7/4.8/4.9/4.10 Regression] ICE: in get_seqno_for_a_jump, at sel-sched-ir.c:4068 with -fselective-scheduling -fno-if-conversion

2014-04-17 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60866

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org ---
Started with r208165 on the trunk (which can of course mean it has been latent
before).