Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-16 Thread Richard Biener
On Thu, Nov 16, 2017 at 4:08 AM, Martin Sebor wrote: > On 11/15/2017 03:51 AM, Richard Biener wrote: >> >> On Tue, Nov 14, 2017 at 6:45 PM, Martin Sebor wrote: >>> >>> On 11/14/2017 05:28 AM, Richard Biener wrote: On Mon, Nov 13, 2017 at 6:37

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-15 Thread Martin Sebor
On 11/15/2017 03:51 AM, Richard Biener wrote: On Tue, Nov 14, 2017 at 6:45 PM, Martin Sebor wrote: On 11/14/2017 05:28 AM, Richard Biener wrote: On Mon, Nov 13, 2017 at 6:37 PM, Martin Sebor wrote: Richard, this thread may have been conflated with the

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-15 Thread Martin Sebor
On 11/15/2017 03:51 AM, Richard Biener wrote: On Tue, Nov 14, 2017 at 6:45 PM, Martin Sebor wrote: On 11/14/2017 05:28 AM, Richard Biener wrote: On Mon, Nov 13, 2017 at 6:37 PM, Martin Sebor wrote: Richard, this thread may have been conflated with the

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-15 Thread Richard Biener
On Tue, Nov 14, 2017 at 6:45 PM, Martin Sebor wrote: > On 11/14/2017 05:28 AM, Richard Biener wrote: >> >> On Mon, Nov 13, 2017 at 6:37 PM, Martin Sebor wrote: >>> >>> Richard, this thread may have been conflated with the one Re: >>> [PATCH] enhance

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-14 Thread Martin Sebor
On 11/14/2017 05:28 AM, Richard Biener wrote: On Mon, Nov 13, 2017 at 6:37 PM, Martin Sebor wrote: Richard, this thread may have been conflated with the one Re: [PATCH] enhance -Warray-bounds to detect out-of-bounds offsets (PR 82455) They are about different things. I'm

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-14 Thread Richard Biener
On Mon, Nov 13, 2017 at 6:37 PM, Martin Sebor wrote: > Richard, this thread may have been conflated with the one Re: > [PATCH] enhance -Warray-bounds to detect out-of-bounds offsets > (PR 82455) They are about different things. > > I'm still looking for approval of: > >

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-13 Thread Martin Sebor
Richard, this thread may have been conflated with the one Re: [PATCH] enhance -Warray-bounds to detect out-of-bounds offsets (PR 82455) They are about different things. I'm still looking for approval of: https://gcc.gnu.org/ml/gcc-patches/2017-10/msg01208.html Thanks Martin The difficulty

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-07 Thread Martin Sebor
On 11/07/2017 03:18 AM, Richard Biener wrote: On Tue, Nov 7, 2017 at 4:23 AM, Martin Sebor wrote: On 11/06/2017 11:41 AM, Jeff Law wrote: On 10/29/2017 10:15 AM, Martin Sebor wrote: Ping -- please see my reply below. On 10/20/2017 09:57 AM, Richard Biener wrote:

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-07 Thread Richard Biener
On Tue, Nov 7, 2017 at 4:23 AM, Martin Sebor wrote: > On 11/06/2017 11:41 AM, Jeff Law wrote: >> >> On 10/29/2017 10:15 AM, Martin Sebor wrote: >>> >>> Ping -- please see my reply below. >>> >>> On 10/20/2017 09:57 AM, Richard Biener wrote:

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-06 Thread Martin Sebor
On 11/06/2017 11:41 AM, Jeff Law wrote: On 10/29/2017 10:15 AM, Martin Sebor wrote: Ping -- please see my reply below. On 10/20/2017 09:57 AM, Richard Biener wrote: get_addr_base_and_unit_offset will return NULL if there's any variable component in 'ref'. So as written it seems to be dead

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-06 Thread Martin Sebor
On 10/30/2017 06:02 AM, Richard Biener wrote: On Sun, Oct 29, 2017 at 5:15 PM, Martin Sebor wrote: Ping -- please see my reply below. On 10/20/2017 09:57 AM, Richard Biener wrote: get_addr_base_and_unit_offset will return NULL if there's any variable component in

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-11-06 Thread Jeff Law
On 10/29/2017 10:15 AM, Martin Sebor wrote: > Ping -- please see my reply below. > > On 10/20/2017 09:57 AM, Richard Biener wrote: >> get_addr_base_and_unit_offset will return NULL if there's any >>> variable >> component in 'ref'.  So as written it seems to be dead code (you >> want

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-30 Thread Richard Biener
On Sun, Oct 29, 2017 at 5:15 PM, Martin Sebor wrote: > Ping -- please see my reply below. > > > On 10/20/2017 09:57 AM, Richard Biener wrote: >> >> get_addr_base_and_unit_offset will return NULL if there's any >>> >>> variable >> >> component in 'ref'. So as

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-29 Thread Martin Sebor
Ping -- please see my reply below. On 10/20/2017 09:57 AM, Richard Biener wrote: get_addr_base_and_unit_offset will return NULL if there's any variable component in 'ref'. So as written it seems to be dead code (you want to pass 'arg'?) Sorry, I'm not sure I understand what you mean.

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-20 Thread Richard Biener
On October 20, 2017 5:43:40 PM GMT+02:00, Martin Sebor wrote: >On 10/20/2017 02:08 AM, Richard Biener wrote: >> On Fri, Oct 20, 2017 at 1:00 AM, Martin Sebor >wrote: >>> On 10/19/2017 02:34 AM, Richard Biener wrote: On Thu, Oct 19, 2017 at 1:19 AM,

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-20 Thread Martin Sebor
On 10/20/2017 02:08 AM, Richard Biener wrote: On Fri, Oct 20, 2017 at 1:00 AM, Martin Sebor wrote: On 10/19/2017 02:34 AM, Richard Biener wrote: On Thu, Oct 19, 2017 at 1:19 AM, Martin Sebor wrote: On 10/18/2017 04:48 AM, Richard Biener wrote: On

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-20 Thread Richard Biener
On Fri, Oct 20, 2017 at 1:00 AM, Martin Sebor wrote: > On 10/19/2017 02:34 AM, Richard Biener wrote: >> >> On Thu, Oct 19, 2017 at 1:19 AM, Martin Sebor wrote: >>> >>> On 10/18/2017 04:48 AM, Richard Biener wrote: On Wed, Oct 18, 2017 at 5:34

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-19 Thread Martin Sebor
On 10/19/2017 02:34 AM, Richard Biener wrote: On Thu, Oct 19, 2017 at 1:19 AM, Martin Sebor wrote: On 10/18/2017 04:48 AM, Richard Biener wrote: On Wed, Oct 18, 2017 at 5:34 AM, Martin Sebor wrote: While testing my latest -Wrestrict changes I noticed a

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-19 Thread Martin Sebor
Good question! STRING_CST does have a domain. The problem is that array_at_struct_end_p() returns true for STRING_CST. I've added the handling to the function and removed the block above from the latest patch. Can you split out the STRING_CST handling and commit that separately (split the

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-19 Thread Richard Biener
On Thu, Oct 19, 2017 at 1:19 AM, Martin Sebor wrote: > On 10/18/2017 04:48 AM, Richard Biener wrote: >> >> On Wed, Oct 18, 2017 at 5:34 AM, Martin Sebor wrote: >>> >>> While testing my latest -Wrestrict changes I noticed a number of >>> opportunities to

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-18 Thread Martin Sebor
On 10/18/2017 04:48 AM, Richard Biener wrote: On Wed, Oct 18, 2017 at 5:34 AM, Martin Sebor wrote: While testing my latest -Wrestrict changes I noticed a number of opportunities to improve the -Warray-bounds warning. Attached is a patch that implements a solution for the

Re: [PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-18 Thread Richard Biener
On Wed, Oct 18, 2017 at 5:34 AM, Martin Sebor wrote: > While testing my latest -Wrestrict changes I noticed a number of > opportunities to improve the -Warray-bounds warning. Attached > is a patch that implements a solution for the following subset > of these: > > PR

[PATCH] enhance -Warray-bounds to handle strings and excessive indices

2017-10-17 Thread Martin Sebor
While testing my latest -Wrestrict changes I noticed a number of opportunities to improve the -Warray-bounds warning. Attached is a patch that implements a solution for the following subset of these: PR tree-optimization/82596 - missing -Warray-bounds on an out-of bounds index into string