This is the mail archive of the gcc-bugs@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]

[Bug target/46483] Built-in memcpy() does not handle unaligned int for ARM


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.


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