On Mon, Sep 7, 2026 at 7:45 AM <[email protected]> wrote:
>
> From: Kyrylo Tkachov <[email protected]>
>
> noce_try_cond_arith is the only noce_try_* matcher still declared to
> return int, although it only ever returns bool literals.  Make its
> return type bool in line with its siblings so the dispatcher does not
> rely on an implicit int->bool conversion.
>
> block_jumps_and_fallthru tests two bool flags with a bitwise & where a
> logical test is meant.  Use logical operators instead.  Both changes are
> no functional change.
>
> gcc/ChangeLog:
>
>         * ifcvt.cc (noce_try_cond_arith): Return bool instead of int.
>         (block_jumps_and_fallthru): Use a logical test on the bool flags.

Ok.

>
> Signed-off-by: Kyrylo Tkachov <[email protected]>
> ---
>  gcc/ifcvt.cc | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc
> index e5dc4926600..b5a1ccab9a6 100644
> --- a/gcc/ifcvt.cc
> +++ b/gcc/ifcvt.cc
> @@ -3558,7 +3558,7 @@ get_base_reg_or_constant (rtx exp)
>      or `cond ? z : -1`.
>    */
>
> -static int
> +static bool
>  noce_try_cond_arith (struct noce_if_info *if_info)
>  {
>    rtx target, a, b, a_op0, a_op1, outer_a;
> @@ -5930,7 +5930,7 @@ block_jumps_and_fallthru (basic_block cur_bb, 
> basic_block target_bb)
>         return -1;
>      }
>
> -  if ((jump_p & fallthru_p) == 0)
> +  if (!jump_p || !fallthru_p)
>      return -1;
>
>    /* Don't allow calls in the block, since this is used to group && and ||
> --
> 2.50.1 (Apple Git-155)
>

Reply via email to