[Bug middle-end/112733] [14 Regression] ICE: Segmentation fault in wide-int.cc during GIMPLE pass: sccp

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 28 16:01:08 GMT 2023


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

--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Actually, maybe better variant of the first fix in the above comment would be:
--- gcc/wide-int.cc.jj  2023-11-28 16:56:50.000000000 +0100
+++ gcc/wide-int.cc     2023-11-28 16:58:02.268776755 +0100
@@ -1985,6 +1985,8 @@ wi::divmod_internal (HOST_WIDE_INT *quot

   if (remainder)
     {
+      if (n > dividend_blocks_needed)
+       n = dividend_blocks_needed;
       *remainder_len = wi_pack (remainder, b_remainder, n, dividend_prec);
       /* The remainder is always the same sign as the dividend.  */
       if (dividend_neg)
where the check which is useless for multiplication and quotient is done only
in the problematic spot - remainder.


More information about the Gcc-bugs mailing list