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

Andrey Belevantsev <abel at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2012-03-26
         AssignedTo|unassigned at gcc dot       |abel at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #1 from Andrey Belevantsev <abel at gcc dot gnu.org> 2012-03-26 
12:26:53 UTC ---
Sigh.  Of course optimizing calculation of whether an insn change the state as
in PR 52203 was wrong, one needs to calculate this right before actually
scheduling the insn as the state may change.  Thus, reverting the fix for 52203
and doing the below instead is not only safe but correct:

diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c
index 2829f60..f5ae9817 100644
--- a/gcc/sel-sched.c
+++ b/gcc/sel-sched.c
@@ -7127,8 +7124,14 @@ reset_sched_cycles_in_current_ebb (void)

       if (real_insn)
        {
+         static state_t temp = NULL;
+
+         if (!temp)
+           temp = xmalloc (dfa_state_size);
+         memcpy (temp, curr_state, dfa_state_size);
+
          cost = state_transition (curr_state, insn);
-         if (!empty)
+         if (memcmp (temp, curr_state, dfa_state_size))
            issued_insns++;

           if (sched_verbose >= 2)

Reply via email to