[Bug tree-optimization/86075] dead store elimination defeats strlen optimization after memset zero followed by strcpy

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 7 08:09:00 GMT 2018


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.


More information about the Gcc-bugs mailing list