This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/52415] memcpy to local variable generates unnecessary stack frame for armv7
- From: "jay.foad at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Feb 2012 11:51:00 +0000
- Subject: [Bug target/52415] memcpy to local variable generates unnecessary stack frame for armv7
- Auto-submitted: auto-generated
- References: <bug-52415-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52415
--- Comment #2 from Jay Foad <jay.foad at gmail dot com> 2012-02-28 11:51:00 UTC ---
> On the tree level nothing guarantees that 'p' is properly aligned.
This is a digression, but what about C99 (Committee Draft -- April 12, 2011)
6.3.2.3p7:
"A pointer to an object type may be converted to a pointer to a different
object type. If the resulting pointer is not correctly aligned for the
referenced type, the behavior is undefined."
Doesn't that guarantee that p is properly aligned? If not, how can I assert
that p *is* properly aligned, so the compiler can turn the memcpy into an
aligned load? Thanks.