This is the mail archive of the gcc-patches@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: C++ PATCH to refer to base members using COMPONENT_REF


Jason Merrill wrote:

	(layout_class_type): Change base fields to their real type
	after layout is done.

This particular part of your change seems dangerous to me.


It might tell the alias analysis code that assignment to the base field might alias any of the types of the fields in the complete type when really it can only alias things in the base type. Also, it makes it hard for us to use the base fields in other places (like assignments generated by copy constructors) where it might be advantageous to the optimizers to see what was really going on. (We can't use them any more because they'll have types that don't match reality. Also, DECL_FIELD_SIZE and TYPE_SIZE will probably not match any more.)

I think you should instead leave the base field types as they are, but use FIELD_DECLs from the base type instead of the complete type.

(BTW, this implementation technique is what I've seen implemented in two other front ends.)

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


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