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: [PATCH]: Fix PR tree-optimization/21407


Mike Stump <mrs@apple.com> writes:

> On May 11, 2005, at 5:25 AM, Kenneth Zadeck wrote:
>> I wonder, Mike, do you make any distinction between a c program
>> that upcasts on the first field of a record and one that uses the
>> offsetof operator to upcast from the middle of a record?
>
> I don't, but Geoff does as I recall, which is I think what your
> question was.
[...]

I must point out that upcasting from the middle of a record is used in
GCC itself:

/* Translate a hash table identifier pointer to a tree_identifier
   pointer, and vice versa.  */

#define HT_IDENT_TO_GCC_IDENT(NODE) \
  ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
#define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)

zw


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