This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
- From: "wilson at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 28 Sep 2015 21:39:52 +0000
- Subject: [Bug debug/66068] [6 Regression] error: type variant has different TYPE_VFIELD
- Auto-submitted: auto-generated
- References: <bug-66068-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66068
Jim Wilson <wilson at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wilson at gcc dot gnu.org
--- Comment #6 from Jim Wilson <wilson at gcc dot gnu.org> ---
The problem is in c_build_qualified_type. It calls build_qualified_type at the
end which copies every field to create a new type, including TYPE_VFIELD. But
this is wrong, as TYPE_VFIELD is set in the main variant type, but should not
be set in the qualified type. To fix this, I would suggest storing the result
of build_qualify_type in a local var, and then clearing C_TYPE_INCOMPLETE_VARS
(aka TYPE_VFIELD) if this is a struct or union type.
An alternative solution would be to clear TYPE_VFIELD somewhere lower down,
such as in build_distinct_type_copy, but that would affect every front end, so
it isn't obvious if this is safe. Fixing the problem in the C front end is
clearly a safer solution.