https://gcc.gnu.org/g:35e9b05f1ac3fbdd3dd579a05923eb5d6847659d
commit r17-3989-g35e9b05f1ac3fbdd3dd579a05923eb5d6847659d Author: Kyrylo Tkachov <[email protected]> Date: Wed Jul 22 16:22:06 2026 +0200 ifcvt: minor cleanups in noce_try_cond_arith and block_jumps_and_fallthru 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. Signed-off-by: Kyrylo Tkachov <[email protected]> Diff: --- gcc/ifcvt.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/ifcvt.cc b/gcc/ifcvt.cc index e5dc49266008..b5a1ccab9a6f 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 ||
