Jozef Lawrynowicz <joze...@mittosystems.com> writes:
> is_int_mode does not allow MODE_PARTIAL_INT modes, so convert_modes was
> not allowing a constant value to be converted to a MODE_PARTIAL_INT for
> use as operand 2 in patterns such as ashlpsi3. The constant had
> to be copied into a register before it could be used, but now can be
> used directly as an operand without any copying.

Yeah.  I guess this dates back to when MODE_PARTIAL_INTs didn't have
a known precision.

> diff --git a/gcc/expr.c b/gcc/expr.c
> index c7c3e9fd655..5a252f0935f 100644
> --- a/gcc/expr.c
> +++ b/gcc/expr.c
> @@ -696,7 +696,7 @@ convert_modes (machine_mode mode, machine_mode oldmode, 
> rtx x, int unsignedp)
>      return x;
>  
>    if (CONST_SCALAR_INT_P (x)
> -      && is_int_mode (mode, &int_mode))
> +      && is_a <scalar_int_mode> (mode, &int_mode))
>      {
>        /* If the caller did not tell us the old mode, then there is not
>        much to do with respect to canonicalization.  We have to

I think we also need to change the condition in:

      /* If the caller did not tell us the old mode, then there is not
         much to do with respect to canonicalization.  We have to
         assume that all the bits are significant.  */
      if (GET_MODE_CLASS (oldmode) != MODE_INT)

to is_a <scalar_int_mode> (old_mode)

OK with that, thanks.

Richard

Reply via email to