https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120381
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Martin Uecker <uec...@gcc.gnu.org>: https://gcc.gnu.org/g:0e0f963bcfbfce351dd4aad82e6dbc6fc84a0724 commit r16-982-g0e0f963bcfbfce351dd4aad82e6dbc6fc84a0724 Author: Martin Uecker <uec...@tugraz.at> Date: Thu May 29 19:13:46 2025 +0200 c: fix ICE for mutually recursive structures [PR120381] For invalid nesting of a structure definition in a definition of itself or when using a rather obscure construction using statement expressions, we can create mutually recursive pairs of non-identical but compatible structure types. This can lead to invalid composite types and an ICE. If we detect recursion even for swapped pairs when forming composite types, this is avoided. PR c/120381 gcc/c/ChangeLog: * c-typeck.cc (composite_type_internal): Stop recursion for swapped pairs. gcc/testsuite/ChangeLog: * gcc.dg/pr120381.c: New test. * gcc.dg/gnu23-tag-composite-6.c: New test.