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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Siddhesh Poyarekar
<[email protected]>:

https://gcc.gnu.org/g:715804aab2db43d72078f00e6a96cc290a668e20

commit r14-13020-g715804aab2db43d72078f00e6a96cc290a668e20
Author: Siddhesh Poyarekar <[email protected]>
Date:   Thu Oct 15 20:04:43 2026 -0400

    tree-object-size: Fix reexamine propagation [PR 127899]

    For OST_DYNAMIC, the reexamine flag is set to mark sites using temporary
    SSA names so that they can be freed up during unknown propagation.  For
    this to work correctly, unknown values should not
    be marked for reexamination.  Fix this in plus_stmt_object_size.

    Further, add reexamine propagation in cond_expr too since otherwise one
    could have stale references to temporary SSA names that could
    potentially get freed during unknown propagation.

    Note that for gcc14, builtin-dynamic-object-size-pr127899-1.c has been
    dropped since counted_by is not implemented.

    gcc/ChangeLog:

            PR tree-optimization/127899
            * tree-object-size.cc (plus_stmt_object_size): Reset WHOLESIZE
            if BYTES is unknown.
            (dynamic_object_size): Return bool.
            (cond_expr_object_size): Adjust calls and return REEXAMINE.
            (collect_object_sizes_for): Add assert that size is unknown for
            reexamined objects.

    gcc/testsuite/ChangeLog:

            PR tree-optimization/127899
            * gcc.dg/builtin-dynamic-object-size-pr127899-2.c: Likewise.
            * gcc.dg/builtin-dynamic-object-size-pr127899-3.c: Likewise.

    Signed-off-by: Siddhesh Poyarekar <[email protected]>
    (cherry picked from commit 893e2613ddb928aacfdbae35d96c105ecf18bf82)

Reply via email to