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

msebor@gcc.gnu.org msebor@gcc.gnu.org
Thu Dec 5 01:28:00 GMT 2019


Author: msebor
Date: Thu Dec  5 01:28:11 2019
New Revision: 278983

URL: https://gcc.gnu.org/viewcvs?rev=278983&root=gcc&view=rev
Log:
PR middle-end/91582 - missing heap overflow detection for strcpy

gcc/ChangeLog:

	PR middle-end/91582
	* builtins.c (gimple_call_alloc_size): New function.
	(compute_objsize): Add argument.  Call gimple_call_alloc_size.
	Handle variable offsets and indices.
	* builtins.h (gimple_call_alloc_size): Declare.
	(compute_objsize): Add argument.
	* gcc/gimple-ssa-warn-restrict.c: Remove assertions.
	* tree-ssa-strlen.c (handle_store): Handle calls to allocated objects.

gcc/testsuite/ChangeLog:

	PR middle-end/91582
	* c-c++-common/Wstringop-truncation.c: Remove xfails.
	* g++.dg/warn/Wstringop-overflow-4.C: New test.
	* g++.dg/ext/attr-alloc_size.C: Suppress -Warray-bounds.
	* gcc.dg/Warray-bounds-56.c: New test.
	* gcc.dg/Wstringop-overflow-22.c: New test.
	* gcc.dg/attr-alloc_size.c: Suppress -Warray-bounds.
	* gcc.dg/attr-copy-2.c: Same.
	* gcc.dg/builtin-stringop-chk-5.c: Remove xfails.
	* gcc.dg/builtin-stringop-chk-8.c: Same.  Correct the text of expected
	warnings.
	* gcc.target/i386/pr82002-2a.c: Prune expected warning.
	* gcc.target/i386/pr82002-2b.c: Same.


Added:
    trunk/gcc/testsuite/g++.dg/warn/Wstringop-overflow-4.C
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-56.c
    trunk/gcc/testsuite/gcc.dg/Wstringop-overflow-25.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/builtins.h
    trunk/gcc/gimple-ssa-warn-restrict.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/c-c++-common/Wstringop-truncation.c
    trunk/gcc/testsuite/g++.dg/ext/attr-alloc_size.C
    trunk/gcc/testsuite/gcc.dg/attr-alloc_size.c
    trunk/gcc/testsuite/gcc.dg/attr-copy-2.c
    trunk/gcc/testsuite/gcc.dg/builtin-stringop-chk-5.c
    trunk/gcc/testsuite/gcc.dg/builtin-stringop-chk-8.c
    trunk/gcc/testsuite/gcc.target/i386/pr82002-2a.c
    trunk/gcc/testsuite/gcc.target/i386/pr82002-2b.c
    trunk/gcc/tree-ssa-strlen.c



More information about the Gcc-cvs mailing list