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] VEC and tree aliasing


Richard Kenner wrote:
I've just bootstrapped my patch with an added assertion making sure
the invariant that if DECL_FIELDS is a FIELD_DECL, then
bitpos_of_field of that field is zero is actually true.


I'm not sure I follow.  Are you assuming here that there is *some* field
that is at position zero?

It appears so, so I'm not sure what the Ada issue was.

I don't recall what the Ada issue was, but the above isn't true for Ada:
it's trivial to have a representation clause for a record so that no
field is at position zero.  Unfortunately, the compiler isn't going to
be a test case for that and I don't think the ACATS is either ...

The original code in push_fields_into_field_stack ignored the bitpos_of_field for a FIELD_DECL that was the first thing on the TYPE_FIELDS list. Danny recalled that this was because some FE created such a field where the bitpos_of_field was nonzero BUT the field was placed at offset zero.

I knew of no such behaviour and thought any such FE would be broken.
The patch removes such odd handling, but retains an assert to make sure
the first field is always at offset zero.  That assertion is true for
C, C++ and Java but I don't know about other languages.  From
what I understand, it doesn't matter if the first field is not at offset
zero, but it does matter that things are consistent!

nathan

--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk


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