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

Ilya Enkovich <ienkovich at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ienkovich at gcc dot 
gnu.org

--- Comment #6 from Ilya Enkovich <ienkovich at gcc dot gnu.org> ---
Thanks a lot for your analysis!  When chain is built we scan all register
definitions and their uses.  Thus it includes all register definitions and
uses.  Uninitialized uses are missed though.  Simply skipping them in
convert_reg should be OK.  I'm testing this patch:

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fa7d3ff..3d8dbc4 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -3372,8 +3372,11 @@ scalar_chain::convert_reg (unsigned regno)
            bitmap_clear_bit (conv, DF_REF_INSN_UID (ref));
          }
       }
-    else if (NONDEBUG_INSN_P (DF_REF_INSN (ref)))
+    /* Skip debug insns and uninitialized uses.  */
+    else if (DF_REF_CHAIN (ref)
+            && NONDEBUG_INSN_P (DF_REF_INSN (ref)))
       {
+       gcc_assert (scopy);
        replace_rtx (DF_REF_INSN (ref), reg, scopy);
        df_insn_rescan (DF_REF_INSN (ref));
       }


I'm not sure what's wrong with debug insns.  If register is converted into a
vector one then why can't it be used in debug insns?  It is still the same DI
reg with the same value, we just replace its uses with V2DI subreg uses to
force SSE hard reg allocation.

Reply via email to