Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-25 Thread Richard Sandiford
Martin Sebor writes: >> Just a stylistic thing, but since the only use of "wone" is in >> the eq_p, it'd be simpler just to use "1". Also, the maximum >> value is better calculated as "wi::max_value (prec, SIGNED)". So: >> >> /* Compute the value of SSIZE_MAX, the largest positive value that >

Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-25 Thread Martin Sebor
Just a stylistic thing, but since the only use of "wone" is in the eq_p, it'd be simpler just to use "1". Also, the maximum value is better calculated as "wi::max_value (prec, SIGNED)". So: /* Compute the value of SSIZE_MAX, the largest positive value that can be stored in ssize_t, the s

Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-25 Thread Richard Sandiford
Martin Sebor writes: > On 08/24/2017 08:03 AM, Richard Biener wrote: >> On Wed, Aug 23, 2017 at 9:42 PM, Martin Sebor wrote: >>> Bug 81908 is about a -Wstringop-overflow warning for a Fortran >>> test triggered by a recent VRP improvement. A simple test case >>> that approximates the warning is:

Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-24 Thread Richard Biener
On August 24, 2017 11:52:41 PM GMT+02:00, Jeff Law wrote: >On 08/24/2017 09:03 AM, Martin Sebor wrote: >> On 08/24/2017 08:03 AM, Richard Biener wrote: >>> On Wed, Aug 23, 2017 at 9:42 PM, Martin Sebor >wrote: Bug 81908 is about a -Wstringop-overflow warning for a Fortran test triggered

Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-24 Thread Martin Sebor
On 08/24/2017 03:52 PM, Jeff Law wrote: On 08/24/2017 09:03 AM, Martin Sebor wrote: On 08/24/2017 08:03 AM, Richard Biener wrote: On Wed, Aug 23, 2017 at 9:42 PM, Martin Sebor wrote: Bug 81908 is about a -Wstringop-overflow warning for a Fortran test triggered by a recent VRP improvement. A

Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-24 Thread Jeff Law
On 08/24/2017 09:03 AM, Martin Sebor wrote: > On 08/24/2017 08:03 AM, Richard Biener wrote: >> On Wed, Aug 23, 2017 at 9:42 PM, Martin Sebor wrote: >>> Bug 81908 is about a -Wstringop-overflow warning for a Fortran >>> test triggered by a recent VRP improvement. A simple test case >>> that approx

Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-24 Thread Martin Sebor
On 08/24/2017 08:03 AM, Richard Biener wrote: On Wed, Aug 23, 2017 at 9:42 PM, Martin Sebor wrote: Bug 81908 is about a -Wstringop-overflow warning for a Fortran test triggered by a recent VRP improvement. A simple test case that approximates the warning is: void f (char *d, const char *s,

Re: [PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-24 Thread Richard Biener
On Wed, Aug 23, 2017 at 9:42 PM, Martin Sebor wrote: > Bug 81908 is about a -Wstringop-overflow warning for a Fortran > test triggered by a recent VRP improvement. A simple test case > that approximates the warning is: > > void f (char *d, const char *s, size_t n) > { > if (n > 0 && n <=

[PATCH] handle pathological anti-ranges in gimple_fold_builtin_memory_op (PR 81908)

2017-08-23 Thread Martin Sebor
Bug 81908 is about a -Wstringop-overflow warning for a Fortran test triggered by a recent VRP improvement. A simple test case that approximates the warning is: void f (char *d, const char *s, size_t n) { if (n > 0 && n <= SIZE_MAX / 2) n = 0; memcpy (d, s, n); // n in ~[1, S