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

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

https://gcc.gnu.org/g:893e2613ddb928aacfdbae35d96c105ecf18bf82

commit r17-5336-g893e2613ddb928aacfdbae35d96c105ecf18bf82
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.

    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-1.c: New test.
            * 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]>

Reply via email to