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: calloc = malloc + memset


On June 23, 2014 5:51:30 PM CEST, Marc Glisse <marc.glisse@inria.fr> wrote:
>On Mon, 23 Jun 2014, Jakub Jelinek wrote:
>
>> Ok for trunk, sorry for the delay.
>
>Thanks. Richard has moved the passes a bit since then, but I still have
>
>exactly one spot where the testsuite is ok :-) I need strlen to be
>after 
>dom (for calloc.C) and before vrp (for several strlenopt-*.c). I'll
>commit 
>it tomorrow if there aren't any comments on the pass placement.

But vrp does not run at -O1 - does strlenopt?

>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.



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