This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/86075] dead store elimination defeats strlen optimization after memset zero followed by strcpy
- 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, 07 Jun 2018 08:09:51 +0000
- Subject: [Bug tree-optimization/86075] dead store elimination defeats strlen optimization after memset zero followed by strcpy
- Auto-submitted: auto-generated
- References: <bug-86075-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86075
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-06-07
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
But then the strlen pass should see the zeroing and then notice the memcpy will
produce a 0-terminated string. The user might have written this w/o the
a[3] = 0 in place after all.
So IMHO not a DSE fault but possibly a dup of another strlen missed
optimization.