[Bug tree-optimization/93249] [10 Regression] wrong code with __builtin_strncpy() copying empty string
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 14 11:42:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93249
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #5)
> "Proven not to contain any zeros in the first N bytes" where N is the source
> offset in strncpy, would suggest the strlen pass might be more suitable for
> this transformation than DSE.
That is not really possible, because the change it is doing heavily relies on
the DSE pass infrastructure as well as being called from within it.
With get_range_strlen, it can handle some cases, and will just avoid head
trimming of strncpy otherwise, no big deal. Tail trimming and full trimming is
still possible.
More information about the Gcc-bugs
mailing list