Re: [PATCH] handle local aggregate initialization in strlen, take 2 (PR 83821)

2019-10-16 Thread Jakub Jelinek
On Mon, Oct 14, 2019 at 06:23:22PM -0600, Martin Sebor wrote: > > gcc/ChangeLog: > > PR tree-optimization/83821 > * tree-ssa-strlen.c (maybe_invalidate): Add argument. Consider > the length of a string when available. > + fprintf (dump_file, > +

Re: [PATCH] handle local aggregate initialization in strlen, take 2 (PR 83821)

2019-10-16 Thread Jeff Law
On 10/14/19 6:23 PM, Martin Sebor wrote: > When a subsequent element or member of a local aggregate containing > a prior character array is initialized the strlen pass discards > the length it computed for the prior element/member.  E.g., here: > >   struct { char a[4], b[4]; } s = { "1", "12" };

[PATCH] handle local aggregate initialization in strlen, take 2 (PR 83821)

2019-10-14 Thread Martin Sebor
When a subsequent element or member of a local aggregate containing a prior character array is initialized the strlen pass discards the length it computed for the prior element/member. E.g., here: struct { char a[4], b[4]; } s = { "1", "12" }; even though strlen (s.b) is folded to 2, strlen