[02/05] Fix PR 63384

Alexander Monakov amonakov@ispras.ru
Mon Mar 14 17:13:00 GMT 2016


On Mon, 14 Mar 2016, Andrey Belevantsev wrote:
> Here we're looping because we decrease the counter of the insns we still can
> issue on a DEBUG_INSN thus rendering the counter negative.  The fix is to not
> count debug insns in the corresponding code.  The selective scheduling is
> known to spoil the result of var tracking, but still it is not the reason to
> hang in there.
> 
> The toggle option used in the test seems to be the equivalent of just enabling
> var-tracking-assignments which should lead to the same situation; however, if
> specified as is, var-tracking-assignments will be disabled by the
> toplev.c:1460 code.  Maybe we also need the same treatment for
> flag_var_tracking_assignments_toggle.

Hm, I've tried running the test by hand, and I don't follow you: it loops with
either -fvta or -fvta-toggle, producing the expected warning; and doesn't loop
with just -fvar-tracking, when VTA is implicitely disabled at toplev.c:1460.
Sorry, I might have misled you about this (off-list), but it seems toplev.c is
actually working as intended here.

> Ok for trunk?

OK with the formatting oddity fixed:

diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index c798935..893a3e5 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -4249,7 +4249,8 @@ invoke_aftermath_hooks (fence_t fence, rtx_insn *best_insn, int issue_more)
                                       issue_more);
       memcpy (FENCE_STATE (fence), curr_state, dfa_state_size);
     }
-  else if (GET_CODE (PATTERN (best_insn)) != USE
+  else if (! DEBUG_INSN_P (best_insn)
+	   && GET_CODE (PATTERN (best_insn)) != USE
            && GET_CODE (PATTERN (best_insn)) != CLOBBER)
     issue_more--;
 
The prevailing style is '!DEBUG_INSN_P' (no space); it's probably better to
use the same indent style (spaces) on the two following lines too.

Thanks.
Alexander



More information about the Gcc-patches mailing list