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]

Re: g++ 3.1 EH broken for irix6.5


> No.  "packed" means "pack this as tightly as possible" meaning to not leave
> any padding between fields.  It also means not to leave any padding at the
> end of the object.  But that leaves totally open what alignment to assign
> to the object, so one might as well assign the most efficient alignment
> consistent with not having any padding, which in this case is the maximum
> alignment.

Your change breaks EH on every platform that requires strict pointer
alignment.  SPARC is broken for me.

The doc says:

`packed'

     The `packed' attribute specifies that a variable or structure
     field should have the smallest possible alignment--one byte for a
     variable, and one bit for a field, unless you specify a larger
     value with the `aligned' attribute.

In this case, the union in question is declared packed, so it should
have the smallest possible alignment, as it says above.

> Have you tried specifying an alignment for the union explicitly?

Again, according to the doc:

     The `aligned' attribute can only increase the alignment; but you
     can decrease it by specifying `packed' as well.

Andrew.


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