r262958 - in /trunk/gcc: ChangeLog builtins.c b...

msebor@gcc.gnu.org msebor@gcc.gnu.org
Wed Jul 25 02:11:00 GMT 2018


Author: msebor
Date: Wed Jul 25 02:11:31 2018
New Revision: 262958

URL: https://gcc.gnu.org/viewcvs?rev=262958&root=gcc&view=rev
Log:
PR tree-optimization/86622 - incorrect strlen of array of array plus variable offset
PR tree-optimization/86532 - Wrong code due to a wrong strlen folding starting with r262522

gcc/ChangeLog:

	PR tree-optimization/86622
	PR tree-optimization/86532
	* builtins.h (string_length): Declare.
	* builtins.c (c_strlen): Correct handling of non-constant offsets.	
	(check_access): Be prepared for non-constant length ranges.
	(string_length): Make extern.
	* expr.c (string_constant): Only handle the minor non-constant
	array index.  Use string_constant to compute the length of
	a generic string constant.

gcc/testsuite/ChangeLog:

	PR tree-optimization/86622
	PR tree-optimization/86532
	* gcc.c-torture/execute/strlen-2.c: New test.
	* gcc.c-torture/execute/strlen-3.c: New test.
	* gcc.c-torture/execute/strlen-4.c: New test.


Added:
    trunk/gcc/testsuite/gcc.c-torture/execute/strlen-2.c
    trunk/gcc/testsuite/gcc.c-torture/execute/strlen-3.c
    trunk/gcc/testsuite/gcc.c-torture/execute/strlen-4.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/builtins.h
    trunk/gcc/expr.c
    trunk/gcc/testsuite/ChangeLog



More information about the Gcc-cvs mailing list