OSDN Git Service

2011-09-08 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Sep 2011 13:00:23 +0000 (13:00 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 8 Sep 2011 13:00:23 +0000 (13:00 +0000)
commitcac1a11f3af3d104e1fe66763c9beda850a57b0e
treebcaff4692c5de5b68874b434da9ce5fdf5834598
parenta3084c6b4e857804c7215a10377a4432d6f694d1
2011-09-08  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/19831
* tree-ssa-dce.c (mark_all_reaching_defs_necessary_1): Also
skip builtins with vdefs that do not really store something.
(propagate_necessity): For calls to free that we can associate
with an allocation function do not mark the freed pointer
definition necessary.
(eliminate_unnecessary_stmts): Remove a call to free if
the associated call to an allocation function is not necessary.

* gcc.dg/tree-ssa/pr19831-1.c: New testcase.
* gcc.dg/tree-ssa/pr19831-2.c: Likewise.
* gcc.dg/tree-ssa/pr19831-3.c: Likewise.
* gcc.dg/errno-1.c: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178687 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/errno-1.c
gcc/testsuite/gcc.dg/tree-ssa/pr19831-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr19831-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/pr19831-3.c [new file with mode: 0644]
gcc/tree-ssa-dce.c