[Bug rtl-optimization/78120] [6/7 Regression] If conversion no longer performed

bernds at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 11 12:51:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78120

Bernd Schmidt <bernds at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |bernds at gcc dot gnu.org,
                   |                            |jgreenhalgh at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |bernds at gcc dot gnu.org

--- Comment #2 from Bernd Schmidt <bernds at gcc dot gnu.org> ---
Looks like a mismatch where we use different cost calculations to compare
before/after sequences. The following seems to make it come out right, but it
probably needs a lot of testing to make sure it behaves as intended. (James?)

Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c       (revision 242038)
+++ gcc/rtlanal.c       (working copy)
@@ -5224,13 +5224,8 @@ seq_cost (const rtx_insn *seq, bool spee
   rtx set;

   for (; seq; seq = NEXT_INSN (seq))
-    {
-      set = single_set (seq);
-      if (set)
-        cost += set_rtx_cost (set, speed);
-      else
-        cost++;
-    }
+    if (NONDEBUG_INSN_P (seq))
+      cost += insn_rtx_cost (set, speed);

   return cost;
 }


More information about the Gcc-bugs mailing list