On Wed, Feb 4, 2026 at 9:20 AM Andrew Pinski
<[email protected]> wrote:
>
> Just a small cleanup to use true/false instead of 1/0 for the imag_p argument
> of extract_component.
>
> Bootstrapped and tested on x86_64-linux-gnu.
>
> gcc/ChangeLog:
>
> * tree-complex.cc (expand_complex_move): Use true/false instead
> of 1/o for extract_component argument.
> (expand_complex_operations_1): Likewise.
>
> Signed-off-by: Andrew Pinski <[email protected]>
> ---
> gcc/tree-complex.cc | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/gcc/tree-complex.cc b/gcc/tree-complex.cc
> index d2a3ed35590..7cd5aa6300f 100644
> --- a/gcc/tree-complex.cc
> +++ b/gcc/tree-complex.cc
> @@ -884,8 +884,8 @@ expand_complex_move (gimple_stmt_iterator *gsi, tree type)
> {
> if (gimple_assign_rhs_code (stmt) != COMPLEX_EXPR)
> {
> - r = extract_component (gsi, rhs, 0, true);
> - i = extract_component (gsi, rhs, 1, true);
> + r = extract_component (gsi, rhs, false, true);
> + i = extract_component (gsi, rhs, true, true);
Sorry, but this reads just as confusing as before. Can we have enum {
REALPART, IMAGPART }
instread?
> }
> else
> {
> @@ -904,8 +904,8 @@ expand_complex_move (gimple_stmt_iterator *gsi, tree type)
> location_t loc;
>
> loc = gimple_location (stmt);
> - r = extract_component (gsi, rhs, 0, false);
> - i = extract_component (gsi, rhs, 1, false);
> + r = extract_component (gsi, rhs, false, false);
> + i = extract_component (gsi, rhs, true, false);
>
> x = build1 (REALPART_EXPR, inner_type, unshare_expr (lhs));
> t = gimple_build_assign (x, r);
> @@ -1888,8 +1888,8 @@ expand_complex_operations_1 (gimple_stmt_iterator *gsi)
> br = ar, bi = ai;
> else if (bc)
> {
> - br = extract_component (gsi, bc, 0, true);
> - bi = extract_component (gsi, bc, 1, true);
> + br = extract_component (gsi, bc, false, true);
> + bi = extract_component (gsi, bc, true, true);
> }
> else
> br = bi = NULL_TREE;
> --
> 2.43.0
>