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

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So the bug is in
  else if (GET_CODE (inner) == MULT
           && CONST_INT_P (XEXP (inner, 1))
           && pos_rtx == 0 && pos == 0)
    {
      /* We're extracting the least significant bits of an rtx
         (mult X (const_int 2^C)), where LEN > C.  Extract the
         least significant (LEN - C) bits of X, giving an rtx
         whose mode is MODE, then multiply it by 2^C.  */
      const HOST_WIDE_INT shift_amt = exact_log2 (INTVAL (XEXP (inner, 1)));
      if (IN_RANGE (shift_amt, 1, len - 1))
        {
          new_rtx = make_extraction (mode, XEXP (inner, 0),
                                     0, 0, len - shift_amt,
                                     unsignedp, in_dest, in_compare);
          if (new_rtx)
            return gen_rtx_MULT (mode, new_rtx, XEXP (inner, 1));
        }
    }
in combine.cc (make_extraction).
len is 1, it is multiplication by const_int 3, so shift_amt is -1.
And the reason it triggers is that it violates the IN_RANGE requirements:
Note the LOWER bound *is* evaluated twice, and LOWER must not be greater than
UPPER.
Here LOWER is 1, UPPER is 0, so LOWER is greater than UPPER.
This bug has been introduced in PR96998 r11-4563.

Reply via email to