From: Andrew Pinski Date: Sun, 24 Aug 2025 20:45:00 +0000 (-0700) Subject: Forwprop: boolify forward_propagate_into_comparison X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b74fcd033071ca77754427dec682b5f8d3e93dcd;p=thirdparty%2Fgcc.git Forwprop: boolify forward_propagate_into_comparison After changing the return type of remove_prop_source_from_use, forward_propagate_into_comparison will never return 2. So boolify forward_propagate_into_comparison. Bootstrapped and tested on x86_64-linux-gnu. gcc/ChangeLog: * tree-ssa-forwprop.cc (forward_propagate_into_comparison): Boolify. (pass_forwprop::execute): Don't handle return of 2 from forward_propagate_into_comparison. Signed-off-by: Andrew Pinski --- diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index aa096f7e012..9f91cf6ed3a 100644 --- a/gcc/tree-ssa-forwprop.cc +++ b/gcc/tree-ssa-forwprop.cc @@ -500,10 +500,9 @@ forward_propagate_into_comparison_1 (gimple *stmt, /* Propagate from the ssa name definition statements of the assignment from a comparison at *GSI into the conditional if that simplifies it. - Returns 1 if the stmt was modified and 2 if the CFG needs cleanup, - otherwise returns 0. */ + Returns true if the stmt was modified. */ -static int +static bool forward_propagate_into_comparison (gimple_stmt_iterator *gsi) { gimple *stmt = gsi_stmt (*gsi); @@ -534,10 +533,10 @@ forward_propagate_into_comparison (gimple_stmt_iterator *gsi) remove_prop_source_from_use (rhs1); if (TREE_CODE (rhs2) == SSA_NAME) remove_prop_source_from_use (rhs2); - return 1; + return true; } - return 0; + return false; } /* Propagate from the ssa name definition statements of COND_EXPR @@ -5020,13 +5019,7 @@ pass_forwprop::execute (function *fun) } if (TREE_CODE_CLASS (code) == tcc_comparison) - { - int did_something; - did_something = forward_propagate_into_comparison (&gsi); - if (did_something == 2) - cfg_changed = true; - changed |= did_something != 0; - } + changed |= forward_propagate_into_comparison (&gsi); else if ((code == PLUS_EXPR || code == BIT_IOR_EXPR || code == BIT_XOR_EXPR)