[Bug middle-end/39954] [4.5 Regression] Revision 146817 caused unaligned access in gcc.dg/torture/pr26565.c

matz at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed May 6 11:58:00 GMT 2009



------- Comment #18 from matz at gcc dot gnu dot org  2009-05-06 11:57 -------
The structure in this testcase is not packed.  One member is.  Or are you
talking about some different case?

Let's suppose you are and you mean something like this:
  struct S {T1 m1; T2 m2; ...} __attribute__((packed));
then IMO all members should also have DECL_PACKED set.  I don't think this
is currently the case (only TYPE_PACKED is set on the whole struct type), but
conceptually that is the ultimate meaning.

If we don't do that we still can create such unaligned types when building
COMPONENT_REFs, when the base datum has TYPE_PACKED set, i.e. option (2).
But let's deal with one case after the other, I'm currently concerned with
only packed members.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39954



More information about the Gcc-bugs mailing list