[Bug middle-end/29272] [4.2 Regression] memcpy optimization causes wrong-code

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Sep 28 17:57:00 GMT 2006

------- Comment #1 from jakub at gcc dot gnu dot org  2006-09-28 17:57 -------
I think after we want to look through handled_component_p's of destvar/srcvar
(in fold_builtin_memory_op) resp. var (in fold_builtin_memset) and see if
inside is a VAR_DECL or not.  If it is a VAR_DECL, then I believe the
optimization is always safe, if it is INDIRECT_REF of a pointer, then it would
be only safe if we can make the read resp. write use forcibly alias set 0.
If we e.g. made a copy of the pointer and set DECL_POINTER_ALIAS_SET on it,
would that work and not be optimized out?


jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
                 CC|                            |rth at gcc dot gnu dot org,
                   |                            |dnovillo at redhat dot com


More information about the Gcc-bugs mailing list