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

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

https://gcc.gnu.org/g:cd4d3a14b231cd5a0e38034e1aa155078944bc8e

commit r16-5999-gcd4d3a14b231cd5a0e38034e1aa155078944bc8e
Author: Qing Zhao <[email protected]>
Date:   Tue Dec 9 14:21:55 2025 +0000

    c: ICE in gimplify_expr when counted_by for pointer is added [PR122982]

    The first argument of the call to .ACCESS_WITH_SIZE includes
    "c_maybe_const_expr" which should not be passed to gimplifier.

    Before passing the expression as the first argument to the call to
    .ACCESS_WITH_SIZE, c_fully_fold should be called on this expression.

            PR c/122982

    gcc/c/ChangeLog:

            * c-typeck.cc (build_access_with_size_for_counted_by): Call
            c_fully_fold on the first parameter.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pointer-counted-by-pr122982.c: New test.

Reply via email to