This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/29272] [4.2 Regression] memcpy optimization causes wrong-code
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2006 11:49:36 -0000
- Subject: [Bug middle-end/29272] [4.2 Regression] memcpy optimization causes wrong-code
- References: <bug-29272-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #11 from jakub at gcc dot gnu dot org 2006-09-30 11:49 -------
The primary advantage of the single entry optimization is actually that
at tree level we can find out if something is only addressable because of the
memcpy/memset/mempcpy/memmove and not for other reasons. So, creating
a pointer to the object, adding may_alias attribute to the type and
dereferencing
it doesn't buy us much, because it would still be addressable. So, either
we have a way to mark the VAR_DECL (or component thereof) read resp. write
with alias set 0, or we need the patch I posted, possibly with additional
check for C++/ObjC++ and don't do the optimization at all for C++.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29272