On Thu, Jul 9, 2026 at 6:25 PM Kael Andrew Franco <[email protected]> wrote:
>
> From 511b73301d1a4a002ae303e695b3aa5ab94599bf Mon Sep 17 00:00:00 2001
> From: Kael Andrew Alonzo Franco <[email protected]>
> Date: Thu, 9 Jul 2026 18:29:07 -0400
> Subject: [PATCH] match: Remove one build_minus_one_cst (type) in r15-6257.
>
> Since all operands has the same type, integer_minus_onep@1 can be used
> instead of build_minus_one_cst (type) to remove function call.
>
> Bootstrapped and tested on x86_64-pc-linux-gnu.
>
> gcc/ChangeLog:
>
> * match.pd: Remove one build_minus_one_cst (type) in r15-6257.
>
> Signed-off-by: Kael Franco <[email protected]>
> ---
>  gcc/match.pd | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/match.pd b/gcc/match.pd
> index a7b658e9e94..42c6f617cfd 100644
> --- a/gcc/match.pd
> +++ b/gcc/match.pd
> @@ -1594,10 +1594,10 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
>     (a - 1) ^ -a -> -1.  */
>  (for bit_op (bit_ior bit_xor bit_and)
>   (simplify
> -  (bit_op:c (plus @0 integer_minus_onep) (negate @0))
> +  (bit_op:c (plus @0 integer_minus_onep@1) (negate @0))
>    (if (bit_op == BIT_AND_EXPR)
>      { build_zero_cst (type); }
> -    { build_minus_one_cst (type); }))
> +    { @1; }))

just `@1` rather than `{ @1; }`.

>   (simplify
>    (bit_op:c (minus @0 integer_onep) (negate @0))
>    (if (bit_op == BIT_AND_EXPR)
> --
> 2.55.0
>
>

Reply via email to