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

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 #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 43922
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43922&action=edit
gcc8-pr85376.patch

The problem is that cse.c (fold_rtx) uses simplify_unary_operation and that
contains stuff like:
          else if (! CLZ_DEFINED_VALUE_AT_ZERO (imode, int_value))
            int_value = GET_MODE_PRECISION (imode);
That is fine in some optimization passes, where we just want some value for the
expression, but not in cse, where we want to record that some register has this
constant value and then optimize other uses of the same constant,
canonicalizing to that register.  Of course, when the value is not defined for
zero, the register contains some random value, not the constant we've computed.

So, either we can do what the patch does, or punt instead of returning
GET_MODE_PRECISION in simplify-rtx.c.

Reply via email to