Hi Jeff!

On Mon, 2022-10-17 17:47:16 -0600, Jeff Law via Gcc-patches 
<gcc-patches@gcc.gnu.org> wrote:
> --- a/gcc/config/h8300/h8300.cc
> +++ b/gcc/config/h8300/h8300.cc
> @@ -5531,6 +5531,32 @@ h8300_ok_for_sibcall_p (tree fndecl, tree)
>  
>    return 1;
>  }
> +
> +/* Return TRUE if OP is a PRE_INC or PRE_DEC
> +   instruction using REG, FALSE otherwise.  */
> +
> +bool
> +pre_incdec_with_reg (rtx op, int reg)
> +{
> +  /* OP must be a MEM.  */
> +  if (GET_CODE (op) != MEM)
> +    return false;
> +
> +  /* The address must be a PRE_INC or PRE_DEC.  */
> +  op = XEXP (op, 0);
> +  if (GET_CODE (op) != PRE_DEC && GET_CODE (op) != PRE_INC)
> +    return false;
> +
> +  /* It must be a register that is being incremented
> +     or decremented.  */
> +  op = XEXP (op, 0);
> +  if (!REG_P (op))
> +    return false;
> +
> +  /* Finally, check that the register number matches.  */
> +  return REGNO (op) == reg;

This results in a new signed-vs-unsigned warning for me:

[all 2022-10-25 00:41:11] ../../gcc/gcc/config/h8300/h8300.cc: In function 
'bool pre_incdec_with_reg(rtx, int)':
[all 2022-10-25 00:41:11] ../../gcc/gcc/config/h8300/h8300.cc:5557:21: error: 
comparison of integer expressions of different signedness: 'unsigned int' and 
'int' [-Werror=sign-compare]
[all 2022-10-25 00:41:11]  5557 |   return REGNO (op) == reg;

Thanks,
  Jan-Benedict

-- 

Attachment: signature.asc
Description: PGP signature

Reply via email to