This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/46483] Built-in memcpy() does not handle unaligned int for ARM
- From: "mikpe at it dot uu.se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Nov 2010 12:21:25 +0000
- Subject: [Bug target/46483] Built-in memcpy() does not handle unaligned int for ARM
- Auto-submitted: auto-generated
- References: <bug-46483-4@http.gcc.gnu.org/bugzilla/>
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.