Re: [PATCH] tree-optimization: Fix tree dse of strncpy PR93249

2020-01-14 Thread Jeff Law
On Wed, 2020-01-15 at 00:53 +0100, Jakub Jelinek wrote: > Hi! > > As the testcase shows, tail trimming of strncpy in tree-ssa-dse.c is fine, > we just copy or clear fewer bytes in the destination, but unlike > memcpy/memset etc., head trimming is problematic in certain cases. > If we can prove tha

[PATCH] tree-optimization: Fix tree dse of strncpy PR93249

2020-01-14 Thread Jakub Jelinek
Hi! As the testcase shows, tail trimming of strncpy in tree-ssa-dse.c is fine, we just copy or clear fewer bytes in the destination, but unlike memcpy/memset etc., head trimming is problematic in certain cases. If we can prove that there are no zero bytes among initial head_trim bytes, it is ok to