diff options
author | Martin Uecker <uecker@tugraz.at> | 2024-03-30 19:49:48 +0100 |
---|---|---|
committer | Martin Uecker <uecker@tugraz.at> | 2024-05-29 22:23:00 +0200 |
commit | 86b98d939989427ff025bcfd536ad361fcdc699c (patch) | |
tree | a8f902b52285a418806953eefb73a34b32785650 /gcc/COPYING.LIB | |
parent | 915440eed21de367cb41857afb5273aff5bcb737 (diff) | |
download | gcc-86b98d939989427ff025bcfd536ad361fcdc699c.zip gcc-86b98d939989427ff025bcfd536ad361fcdc699c.tar.gz gcc-86b98d939989427ff025bcfd536ad361fcdc699c.tar.bz2 |
C23: fix aliasing for structures/unions with incomplete types
When incomplete structure/union types are completed later, compatibility
of struct types that contain pointers to such types changes. When forming
equivalence classes for TYPE_CANONICAL, we therefor need to be conservative
and treat all structs with the same tag which are pointer targets as
equivalent for purposed of determining equivalency of structure/union
types which contain such types as member. This avoids having to update
TYPE_CANONICAL of such structure/unions recursively. The pointer types
themselves are updated in c_update_type_canonical.
gcc/c/
* c-typeck.cc (comptypes_internal): Add flag to track
whether a struct is the target of a pointer.
(tagged_types_tu_compatible): When forming equivalence
classes, treat nested pointed-to structs as equivalent.
gcc/testsuite/
* gcc.dg/c23-tag-incomplete-alias-1.c: New test.
Diffstat (limited to 'gcc/COPYING.LIB')
0 files changed, 0 insertions, 0 deletions