[PATCH 1/7] Expand the comparison argument of fold_cond_expr_with_comparison

Jeff Law jeffreyalaw@gmail.com
Thu Jun 24 15:11:06 GMT 2021



On 6/23/2021 4:19 PM, apinski--- via Gcc-patches wrote:
> From: Andrew Pinski <apinski@marvell.com>
>
> To make things slightly easiler to convert fold_cond_expr_with_comparison
> over to match.pd, expanding the arg0 argument into 3 different arguments
> is done. Also this was simple because we don't use arg0 after grabbing
> the code and the two operands.
> Also since we do this, we don't need to fold the comparison to
> get the inverse but just use invert_tree_comparison directly.
>
> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>
> gcc/ChangeLog:
>
> 	* fold-const.c (fold_cond_expr_with_comparison):
> 	Exand arg0 into comp_code, arg00, and arg01.
> 	(fold_ternary_loc): Use invert_tree_comparison
> 	instead of fold_invert_truthvalue for the case
> 	where we have A CMP B ? C : A.
OK
jeff



More information about the Gcc-patches mailing list