]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: Fix ICE for redeclaration of structs with different alignment [PR114727]
authorMartin Uecker <uecker@tugraz.at>
Sat, 29 Jun 2024 13:53:43 +0000 (15:53 +0200)
committerMartin Uecker <uecker@gcc.gnu.org>
Tue, 9 Jul 2024 19:05:46 +0000 (21:05 +0200)
commit7825c07bbaf503c47ecedd87e3d64be003b24f2c
tree94851853a2369e15753687013db8b77eba58103d
parent592a746533a278a5fd3e7b5dff004e1846ef26a4
c: Fix ICE for redeclaration of structs with different alignment [PR114727]

For redeclarations of struct in C23, if one has an alignment attribute
that makes the alignment different, we later get an ICE in verify_types.
This patches disallows such redeclarations by declaring such types to
be different.

PR c/114727

gcc/c/
* c-typeck.cc (tagged_types_tu_compatible): Add test.

gcc/testsuite/
* gcc.dg/pr114727.c: New test.
gcc/c/c-typeck.cc
gcc/testsuite/gcc.dg/pr114727.c [new file with mode: 0644]