Re: [PATCH v2] Fix bogus strncpy source length warning on source bound by constant

2018-03-15 Thread Siddhesh Poyarekar
On Wednesday 14 March 2018 08:40 PM, Richard Biener wrote: > Instead of building a tree from max you should use > > if (wi::to_widest (max) < wi::to_widest (wi::to_wide (dstsize))) > return; > > given compute_objsize is somewhat confused about the type it returns > a widest_int compare

Re: [PATCH v2] Fix bogus strncpy source length warning on source bound by constant

2018-03-14 Thread Richard Biener
On Tue, Mar 13, 2018 at 7:22 PM, Siddhesh Poyarekar wrote: > Avoid issuing a bogus warning when the source of strncpy is bound by a > constant known to be less than the minimum size of the destination. > > Changes from v1: > > - Use range-info instead of the MIN_EXPR hack

[PATCH v2] Fix bogus strncpy source length warning on source bound by constant

2018-03-13 Thread Siddhesh Poyarekar
Avoid issuing a bogus warning when the source of strncpy is bound by a constant known to be less than the minimum size of the destination. Changes from v1: - Use range-info instead of the MIN_EXPR hack - Get the minimum size of dst and check for NULL_TREE return The patch bootstraps