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

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #9)
> actually the genemit fix doensn't fully work:
> 
> /space/rguenther/src/svn/trunk/gcc/config/i386/i386.md: In function
> ‘rtx_def* gen_smulsi3_highpart(rtx, rtx, rtx)’:
> /space/rguenther/src/svn/trunk/gcc/config/i386/i386.md:7380:26: error:
> ‘operands[3]’ is used uninitialized in this function [-Werror=uninitialized]
>         (any_extend:TI
>                 ~~~~~~    ^
> /space/rguenther/src/svn/trunk/gcc/config/i386/i386.md: In function
> ‘rtx_def* gen_umulsi3_highpart(rtx, rtx, rtx)’:
> /space/rguenther/src/svn/trunk/gcc/config/i386/i386.md:7380:26: error:
> ‘operands[3]’ is used uninitialized in this function [-Werror=uninitialized]
>         (any_extend:TI
>                 ~~~~~~    ^
> ...
> 
> bah.

--- gcc/genemit.c.jj    2017-01-01 12:45:35.000000000 +0100
+++ gcc/genemit.c       2017-03-01 10:51:27.474179940 +0100
@@ -518,6 +518,9 @@ gen_expand (md_rtx_info *info)
        {
          for (i = 0; i < stats.num_operand_vars; i++)
            {
+             if (i > MAX (stats.max_opno, stats.max_dup_opno)
+                 && i <= stats.max_scratch_opno)
+               continue;
              printf ("    operand%d = operands[%d];\n", i, i);
              printf ("    (void) operand%d;\n", i);
            }

should fix that.  Even if some define_insn doesn't have any match_dups, it can
still have normal operands.

Reply via email to