This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC 4.0 RC2 Available


Andrew Haley wrote:

At compile time we don't know the field offset of fields that we
inherit, because it can change at runtime.  So, we don't set the
FIELD_OFFSET, and that is is why dbxout is aborting.

OK. I certainly can't claim that this aspect of the GCC IR is particularly well specified. For example, whether or not derived classes should include copies of FIELD_DECLs from base classes is not something that I think has been written down anywhere. We don't do that in C++ (instead, we have FIELD_DECLs with the type of the base class), but I don't think that would help in your situation, as you still wouldn't know what offset these FIELD_DECLs would have.


However, these fields are real, and they are used, but we shouldn't
output any debug info for them.  If I were to remove them from the
list of fields they'd have to be recreated because they may be needed
while compiling classes later in the same compilation unit.

OK.


I set DECL_IGNORED_P on these fields because I don't want debuginfo to
pay any attention to them.  I could, I suppose, set their offset to
zero or even error_mark_node, which seems to work.

I think NULL_TREE is a fine value to represent "unknown" -- the fact that it's likely to cause crashes is probably a feature, in that any parts of the compiler that go trying to use the field will probably be found more quickly. So, your original patch is fine for mainline. It's also OK for 4.0.1, after 4.0.0 is out.


Thanks,

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]