[Bug middle-end/60292] [4.9 Regression] ICE: in fill_vec_av_set, at sel-sched.c:3863 with -m64 after r206174 on powerpc-apple-darwin9.8.0

abel at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 21 09:27:00 GMT 2014


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

--- Comment #2 from Andrey Belevantsev <abel at gcc dot gnu.org> ---
Here the assert added while fixing PR 57422 means that we should always be able
to schedule the current fence instruction.  The PR 57422 analysis was good but
for the added assert we should make one more conclusion from it.  In that PR
case, we did the following: 1) reset the fence insn target register
availability because this insn form was scheduled earlier and the pre-computed
availability might be wrong; 2) then properly recompute the possible registers
for this insn and rename it.

The part 2) had the bug which was fixed.  Now, in this PR we also reset the
availability as in the part 1) and then fail to recompute the possible renaming
registers because of the --param limitation to apply the renaming to the most
important insns.  But we are required to do this for the fence insn always if
we want so satisfy the correctness assert I have inserted for the PR 57422.  So
either we always should try renaming for the fence insn, or, easier, not doing
the part 1) (resetting the precomputed availability for the fence insn) at all.
 The unavailable vinsns business was introduced for the case when we schedule
an insn on some fence with renaming and this can invalidate the availability
bits for this insn on the other fence; for the next (fence) insn it is safe to
skip it.

So the below simple patch fixes the test case.  I have looked through the code
to ensure that no other issues like this should arise and so then further
firings of this assert should uncover real bugs (hopefully).

Also, the --param renaming limitation as the reason of this particular bug is
easily verified, as the test case passes with --param
selsched-insns-to-rename=3 (instead of 2, the default).

Dominique, I don't have a darwin machine, can you help me with testing this
patch on darwin?  I will do the x86-64 and ia64.

diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 490f361..241bdad 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -3823,7 +3823,8 @@ fill_vec_av_set (av_set_t av, blist_t bnds, fence_t
fence,

       /* If insn was already scheduled on the current fence,
         set TARGET_AVAILABLE to -1 no matter what expr's attribute says.  */
-      if (vinsn_vec_has_expr_p (vec_target_unavailable_vinsns, expr))
+      if (vinsn_vec_has_expr_p (vec_target_unavailable_vinsns, expr)
+         && !fence_insn_p)
        target_available = -1;

       /* If the availability of the EXPR is invalidated by the insertion of



More information about the Gcc-bugs mailing list