This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Jakub Jelinek <jakub@redhat.com> writes:
> On Tue, May 16, 2017 at 09:02:08AM +0100, Richard Sandiford wrote:
>> 2017-05-16  Richard Sandiford  <richard.sandiford@linaro.org>
>> 
>> 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
>> 	strinfos have delayed lengths or none do.
>> 	(verify_related_strinfos): Move earlier in file.
>> 	(set_endptr_and_length): New function, split out from...
>> 	(get_string_length): ...here.  Also set the lengths of related
>> 	strinfos.
>> 	(zero_length_string): Assert that chainsi has known (rather than
>> 	delayed) lengths.
>> 	(adjust_related_strinfos): Likewise.
>> 
>> gcc/testsuite/
>> 	PR tree-optimization/80769
>> 	* gcc.dg/strlenopt-31.c: New test.
>> 	* gcc.dg/strlenopt-31g.c: Likewise.
>
> Ok for trunk, sorry for the delay.  I assume 7.x is not affected, right?

Thanks, applied.  6.x and 7.x have it too, so I'll try to backport
a minimal fix if there's no fallout on trunk.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]