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: rli->unpadded_align


    I don't understand the purpose of this field.  It seems to be the same as
    rli->record_align, except that it skips the effects of
    BIGGEST_FIELD_ALIGNMENT and ADJUST_FIELD_ALIGN.  Is that actually the
    intention?  If so, why?

Yes, because of desires to be able to lay out records differently for Ada.

    gnat_adjust_rli seems to only use it for TYPE_PACKED records, for which
    field alignments will pretty much all be 1 anyway, right?

No.  stor-layout.c will use the natural alignment if it won't cost anything
in size, for example.

    Hmm, looking at the ada frontend, it seems that you always set
    DECL_ALIGN to TYPE_ALIGN, and rely on layout_decl to reduce the
    alignment as appropriate.  But that shouldn't make any difference to
    rli->unpadded_align; it will still be reflected in DECL_ALIGN.

I'm not 100% certain at this time that this field is actually still used:
that code has changed around a number of times.  I need to spend some time
in the next month or so taking another look at various alignment issues
here and will be reviewing this code at that time.


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