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

--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Martin Uecker
<[email protected]>:

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

commit r15-11251-ga882b00403b809d2d69c87bb471afe17beb0c3e4
Author: Martin Uecker <[email protected]>
Date:   Sun May 10 20:21:40 2026 +0200

    c23: fix TBAA error for function returning structure [PR125252]

    To fix PR122572 we globbed pointers to structure or union types nested
    within other structure or union types to a void pointer when computing
    the TYPE_CANONICAL.  But when doing this for function return types this
    then leads to wrong aliasing decisions, because for some reason function
    derivation behaves differently than pointer and array derivation.  Instead
    of globbing to void, replace the nested structure or union type with an
    incomplete type instead.

            PR c/125252

    gcc/c/ChangeLog:

            * c-typeck.cc (ptr_to_tagged_member): Return type of member.
            (c_type_canonical): Use incomplete type.

    gcc/testsuite/ChangeLog:

            * gcc.dg/pr125252.c

Reply via email to