Re: [2/2] PR 80769: Incorrect strlen optimisation

2017-07-02 Thread Richard Sandiford
Jakub Jelinek writes: > On Tue, May 16, 2017 at 09:02:08AM +0100, Richard Sandiford wrote: >> 2017-05-16 Richard Sandiford >> >> gcc/ >> PR tree-optimization/80769 >> * tree-ssa-strlen.c (strinfo): Document that "stmt" is also used >> for malloc and calloc. Document the new inv

Re: [2/2] PR 80769: Incorrect strlen optimisation

2017-06-30 Thread Jakub Jelinek
On Tue, May 16, 2017 at 09:02:08AM +0100, Richard Sandiford wrote: > 2017-05-16 Richard Sandiford > > gcc/ > PR tree-optimization/80769 > * tree-ssa-strlen.c (strinfo): Document that "stmt" is also used > for malloc and calloc. Document the new invariant that all related >

Re: [2/2] PR 80769: Incorrect strlen optimisation

2017-06-22 Thread Richard Sandiford
Ping*3 Richard Sandiford writes: > Ping*2 > > Richard Sandiford writes: >> In this testcase, we (correctly) record after: >> >> strcpy (p1, "abcde"); >> char *p2 = strchr (p1, '\0'); >> strcpy (p2, q); >> >> that the length of p1 and p2 can be calculated by converting the >> second strcpy

Re: [2/2] PR 80769: Incorrect strlen optimisation

2017-06-11 Thread Richard Sandiford
Ping*2 Richard Sandiford writes: > In this testcase, we (correctly) record after: > > strcpy (p1, "abcde"); > char *p2 = strchr (p1, '\0'); > strcpy (p2, q); > > that the length of p1 and p2 can be calculated by converting the > second strcpy to: > > tmp = stpcpy (p2, q) > > and then doin

Re: [2/2] PR 80769: Incorrect strlen optimisation

2017-05-30 Thread Richard Sandiford
Ping Richard Sandiford writes: > In this testcase, we (correctly) record after: > > strcpy (p1, "abcde"); > char *p2 = strchr (p1, '\0'); > strcpy (p2, q); > > that the length of p1 and p2 can be calculated by converting the > second strcpy to: > > tmp = stpcpy (p2, q) > > and then doing

[2/2] PR 80769: Incorrect strlen optimisation

2017-05-16 Thread Richard Sandiford
In this testcase, we (correctly) record after: strcpy (p1, "abcde"); char *p2 = strchr (p1, '\0'); strcpy (p2, q); that the length of p1 and p2 can be calculated by converting the second strcpy to: tmp = stpcpy (p2, q) and then doing tmp - p1 for p1 and tmp - p2 for p2. This is delayed