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

--- Comment #9 from Mikael Pettersson <mikpe at it dot uu.se> 2010-11-16 
12:21:20 UTC ---
With gcc-4.5.1, the plain assignment is preserved until 141r.expand, which
expands it to a bitfield assignment due to the misalignment check in
expr.c:store_field lines 5836-5840.

The __builtin_memcpy is turned into a plain indirect assignment in 004t.gimple:

set_by_memcpy (struct unaligned_int * p, unsigned int x)
{
  unsigned int * D.2026;
  unsigned int * {ref-all} D.2027;
  unsigned int x.0;

  D.2026 = &p->number;
  D.2027 = (unsigned int * {ref-all}) D.2026;
  x.0 = x;
  *D.2027 = x.0;
}

and this misaligned assignment is never corrected by later passes.

Reply via email to