This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix 9881, break something else
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 20 Apr 2003 19:07:57 -0700
- Subject: Re: [C++ PATCH] Fix 9881, break something else
- Organization: CodeSourcery, LLC
- References: <3EA2901C.3070509@codesourcery.com>
> 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