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: [C++ PATCH] Fix 9881, break something else


> The problem is that by not folding &m.field, we don't treat it as
> an address-constant-expression, and thus it is not a static initializer.
> By folding it, we lose the packedness of the address, and thus
> segfault when deferencing it on strict aligned architecture.
> Why is the type of a packed field, T, rather than
> __attribute__((unaligned)) T? That would seem to solve the problem.

Exactly!  This has been discussed before (by me) on the mailing lists;
alignment is a part of the type.  Note that "packed T" is a supertype of
T; a T has the additional operation of "read T using an aligned load". 

> IMO, fixing 9881 is more important than handling *&m.packed_field.
> 
> built & tested on i686-pc-linux-gnu, ok?

Yes, please proceed with the reversion.

-- 
Mark Mitchell <mark at codesourcery dot com>
CodeSourcery, LLC


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