[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
Mon Jan 13 21:36:00 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93249

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jakub at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Indeed, which means that either we only do tail trimming and not head trimming
for strncpy*, or allow head trimming for strncpy* as well, but only if the
source argument can be proven not to contain any zeros.  The former change
would be trivial, the latter might need slightly more work, will look at it.


More information about the Gcc-bugs mailing list