This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49872] Missed optimization: Could coalesce neighboring memsets
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 28 Jul 2011 10:00:55 +0000
- Subject: [Bug tree-optimization/49872] Missed optimization: Could coalesce neighboring memsets
- Auto-submitted: auto-generated
- References: <bug-49872-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49872
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.07.28 10:00:34
Ever Confirmed|0 |1
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-28 10:00:34 UTC ---
Confirmed.
It should be hard to implement this, but did you see this in real-world code
(to asses the importance of this optimization)?
Other cases would include (partially) overlapping memsets (or related
functions such as memory copying routines and the respective string variants).
We already optimize some cases (that appeared in GCC IIRC) in
tree-ssa-forwprop.c,
namely
/* *GSI_P is a GIMPLE_CALL to a builtin function.
Optimize
memcpy (p, "abcd", 4);
memset (p + 4, ' ', 3);
into
memcpy (p, "abcd ", 7);
call if the latter can be stored by pieces during expansion. */