https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121661

--- Comment #25 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Andrew Pinski <[email protected]>:

https://gcc.gnu.org/g:7c6cb40a44498991ed93d3dd19d128105e8b64b8

commit r16-7289-g7c6cb40a44498991ed93d3dd19d128105e8b64b8
Author: Andrew Pinski <[email protected]>
Date:   Tue Feb 3 19:20:48 2026 -0800

    complex: Directly emit gimple from extract_component [PR121661]

    Currently extract_component uses force_gimple_operand_gsi to emit
    gimple including loads. The problem with that decls that have
    DECL_EXPR_DECL set on it will change over to use the DECL_EXPR_DECL
instead.
    Normally this is ok except for nested functions where the original decl
    is a PARAM_DECL, there is a copy from the param decl to the new frame based
    location.
    Well instead we should just create the gimple ourselves.
    The only special case that needs to be handled is BIT_FIELD_REF and
    a VCE of SSA_NAME. BIT_FIELD_REF was already handled specially
    so we can just emit the load there. VCE of SSA_NAME on the other
    hand needed some extra code.

    Note VCE of s SSA_NAME case could be optimized, I filed PR 123968
    for that. Since that is not a regression at this point and we are
    now producing the same code as before.

    Bootstrapped and tested on x86_64-linux-gnu.

            PR middle-end/121661

    gcc/ChangeLog:

            * tree-complex.cc (extract_component): Create gimple
            assign statements directly rather than call
force_gimple_operand_gsi.

    gcc/testsuite/ChangeLog:

            * gcc.dg/torture/pr121661-1.c: New test.

    Signed-off-by: Andrew Pinski <[email protected]>

Reply via email to