[PATCH PR43513, 1/3] Replace vla with array - Implementation.
Tom de Vries
Tom_deVries@mentor.com
Sun Sep 25 04:47:00 GMT 2011
On 09/24/2011 05:29 PM, Eric Botcazou wrote:
>> This is an updated version of the patch. I have 2 new patches and an
>> updated testcase which I will sent out individually.
>>
>> Patch set was bootstrapped and reg-tested on x86_64.
>>
>> Ok for trunk?
>>
>> Thanks,
>> - Tom
>>
>> 2011-07-30 Tom de Vries <tom@codesourcery.com>
>>
>> PR middle-end/43513
>> * Makefile.in (tree-ssa-ccp.o): Add $(PARAMS_H) to rule.
>> * tree-ssa-ccp.c (params.h): Include.
>> (fold_builtin_alloca_for_var): New function.
>> (ccp_fold_stmt): Use fold_builtin_alloca_for_var.
>
> We have detected another fallout on some Ada code: the transformation replaces
> a call to __builtin_alloca with &var, i.e. it introduces an aliased variable,
> which invalidates the points-to information of some subsequent call, fooling
> DSE into thinking that it can eliminate a live store.
>
> The brute force approach
>
> Index: tree-ssa-ccp.c
> ===================================================================
> --- tree-ssa-ccp.c (revision 179038)
> +++ tree-ssa-ccp.c (working copy)
> @@ -2014,7 +2014,10 @@ do_ssa_ccp (void)
> ccp_initialize ();
> ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node);
> if (ccp_finalize ())
> - return (TODO_cleanup_cfg | TODO_update_ssa | TODO_remove_unused_locals);
> + return (TODO_cleanup_cfg
> + | TODO_update_ssa
> + | TODO_rebuild_alias
> + | TODO_remove_unused_locals);
> else
> return 0;
> }
>
> works, but we might want to be move clever. Thoughts?
>
How about attached (untested) patch implementing a conservative, but
runtime-efficient approach?
Thanks,
- Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr43513-alias.patch
Type: text/x-patch
Size: 1685 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110925/c5133aad/attachment.bin>
More information about the Gcc-patches
mailing list