https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125252
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Uecker <[email protected]>: https://gcc.gnu.org/g:f803a34017ecd95d3c5d15717784ad99709fe0c1 commit r17-1272-gf803a34017ecd95d3c5d15717784ad99709fe0c1 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
