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: alias.c:nonoverlapping_component_refs_p




On Mon, 3 Dec 2001, Richard Kenner wrote:

> I don't believe it is safe to conclude that if two fields aren't the same,
> they don't overlap.  An example of a case where they do is an Ada subtype
> of a variant record.

On a RECORD_TYPE, it should be safe.

As for Ada, the tree.def says:
/* Struct in C, or record in Pascal.  */
/* Special fields:
   TYPE_FIELDS  chain of FIELD_DECLs for the fields of the struct,
     and VAR_DECLs, TYPE_DECLs and CONST_DECLs for record-scope variables,
     types and enumerators.
   A few may need to be added for Pascal.  */
/* See the comment above, before ENUMERAL_TYPE, for how
   forward references to struct tags are handled in C.  */
DEFTREECODE (RECORD_TYPE, "record_type", 't', 0)


If Ada has different semantics, it needs a different tree code, or some
easy way to differentiate.


--Dan


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