Re: [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552)

2018-09-13 Thread Jeff Law
On 9/9/18 3:57 AM, Bernd Edlinger wrote: > On 09/09/18 01:47, Jeff Law wrote: >> On 9/8/18 3:47 PM, Bernd Edlinger wrote: >>> Hi, >>> >>> -fold_builtin_strlen (location_t loc, tree type, tree arg) +fold_builtin_strlen (location_t loc, tree fndecl, tree type, tree arg) { if

Re: [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552)

2018-09-09 Thread Bernd Edlinger
On 09/09/18 01:47, Jeff Law wrote: > On 9/8/18 3:47 PM, Bernd Edlinger wrote: >> Hi, >> >> >>> -fold_builtin_strlen (location_t loc, tree type, tree arg) >>> +fold_builtin_strlen (location_t loc, tree fndecl, tree type, tree arg) >>> { >>> if (!validate_arg (arg, POINTER_TYPE)) >>> retu

Re: [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552)

2018-09-08 Thread Jeff Law
On 9/8/18 3:47 PM, Bernd Edlinger wrote: > Hi, > > >> -fold_builtin_strlen (location_t loc, tree type, tree arg) >> +fold_builtin_strlen (location_t loc, tree fndecl, tree type, tree arg) >> { >>if (!validate_arg (arg, POINTER_TYPE)) >> return NULL_TREE; >>else >> { >> - t

Re: [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552)

2018-09-08 Thread Bernd Edlinger
Hi, > -fold_builtin_strlen (location_t loc, tree type, tree arg) > +fold_builtin_strlen (location_t loc, tree fndecl, tree type, tree arg) > { >if (!validate_arg (arg, POINTER_TYPE)) > return NULL_TREE; >else > { > - tree len = c_strlen (arg, 0); > - > + tree nonstr =

Re: [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552)

2018-08-30 Thread Martin Sebor
On 08/30/2018 04:15 PM, Jeff Law wrote: On 08/13/2018 09:21 PM, Martin Sebor wrote: [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552) The attached changes implement the detection of past-the-end reads by strlen due to unterminated arguments. gcc-86552-2.diff PR tree

Re: [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552)

2018-08-30 Thread Jeff Law
On 08/13/2018 09:21 PM, Martin Sebor wrote: > [PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552) > > The attached changes implement the detection of past-the-end reads > by strlen due to unterminated arguments. > > gcc-86552-2.diff > > >

[PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552)

2018-08-13 Thread Martin Sebor
[PATCH 2/6] detect unterminated const arrays in strlen calls (PR 86552) The attached changes implement the detection of past-the-end reads by strlen due to unterminated arguments. PR tree-optimization/86552 - missing warning for reading past the end gcc/ChangeLog: * builtins.c