diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2014-06-24 20:50:00 +0200 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2014-06-24 18:50:00 +0000 |
commit | 24314386b32b93c759c6722a2c18facae15128ea (patch) | |
tree | 81ba342aeb4db1f2fe70e25917fc6972499cd2d2 /gcc/passes.def | |
parent | 84e0f57e35738500e44fd21753e31295d4700bfb (diff) | |
download | gcc-24314386b32b93c759c6722a2c18facae15128ea.zip gcc-24314386b32b93c759c6722a2c18facae15128ea.tar.gz gcc-24314386b32b93c759c6722a2c18facae15128ea.tar.bz2 |
re PR tree-optimization/57742 (memset(malloc(n),0,n) -> calloc(n,1))
2014-06-24 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/57742
gcc/
* tree-ssa-strlen.c (get_string_length): Ignore malloc.
(handle_builtin_malloc, handle_builtin_memset): New functions.
(strlen_optimize_stmt): Call them.
* passes.def: Move strlen after loop+dom but before vrp.
gcc/testsuite/
* g++.dg/tree-ssa/calloc.C: New testcase.
* gcc.dg/tree-ssa/calloc-1.c: Likewise.
* gcc.dg/tree-ssa/calloc-2.c: Likewise.
* gcc.dg/strlenopt-9.c: Adapt.
From-SVN: r211956
Diffstat (limited to 'gcc/passes.def')
-rw-r--r-- | gcc/passes.def | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/passes.def b/gcc/passes.def index de4c69d..280cf16 100644 --- a/gcc/passes.def +++ b/gcc/passes.def @@ -188,7 +188,6 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_dce); NEXT_PASS (pass_forwprop); NEXT_PASS (pass_phiopt); - NEXT_PASS (pass_strlen); NEXT_PASS (pass_ccp); /* After CCP we rewrite no longer addressed locals into SSA form if possible. */ @@ -251,6 +250,7 @@ along with GCC; see the file COPYING3. If not see NEXT_PASS (pass_reassoc); NEXT_PASS (pass_strength_reduction); NEXT_PASS (pass_dominator); + NEXT_PASS (pass_strlen); NEXT_PASS (pass_vrp); /* The only const/copy propagation opportunities left after DOM and VRP should be due to degenerate PHI nodes. So rather than |