Skip to content
Snippets Groups Projects
Commit 38c33fd2 authored by Martin Uecker's avatar Martin Uecker
Browse files

C: Fix type compatibility for structs with variable sized fields.

This fixes the test gcc.dg/gnu23-tag-4.c introduced by commit 23fee88f
which fails for -march=... because the DECL_FIELD_BIT_OFFSET are set
inconsistently for types with and without variable-sized field.  This
is fixed by testing for DECL_ALIGN instead.  The code is further
simplified by removing some unnecessary conditions, i.e. anon_field is
set unconditionaly and all fields are assumed to be DECL_FIELDs.

gcc/c:
	* c-typeck.cc (tagged_types_tu_compatible_p): Revise.

gcc/testsuite:
	* gcc.dg/c23-tag-9.c: New test.
parent 77f30e22
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment