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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 41252
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41252&action=edit
gcc8-pr80501.patch

Untested fix.

The problematic transformation in the recursive call is:
      /* If we are in a comparison and this is an AND with a power of two,
         convert this into the appropriate bit extract.  */
      else if (in_code == COMPARE
               && (i = exact_log2 (UINTVAL (XEXP (x, 1)))) >= 0
               && (equality_comparison || i < GET_MODE_PRECISION (mode) - 1))
        new_rtx = make_extraction (mode,
                                   make_compound_operation (XEXP (x, 0),
                                                            next_code),
                                   i, NULL_RTX, 1, 1, 0, 1);
which means that EQ is fine, and COMPARE is fine only if the mask is not pow2
or is smaller than the sign bit of the mode.  For the lowpart subreg that means
it must be smaller than the sighn bit of the subreg mode.

Reply via email to