This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, MPX, 2/X] Pointers Checker [16/25] Tail recursion
- From: Ilya Enkovich <enkovich dot gnu at gmail dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 18 Nov 2013 22:10:30 +0400
- Subject: Re: [PATCH, MPX, 2/X] Pointers Checker [16/25] Tail recursion
- Authentication-results: sourceware.org; auth=none
- References: <20131118103733 dot GJ21297 at msticlxl57 dot ims dot intel dot com> <528A52E9 dot 6090102 at redhat dot com>
2013/11/18 Jeff Law <firstname.lastname@example.org>:
> On 11/18/13 03:37, Ilya Enkovich wrote:
>> Here is a patch to disable tail recursion transformation when bounds are
>> passed by call. The reason is BUILT_IN_CHKP_ARG_BND which should always get
>> default SSA_NAME of PARM_DECL as an argument.
>> 2013-11-15 Ilya Enkovich <email@example.com>
>> * tree-tailcall.c: Include tree-chkp.h.
>> (suitable_for_tail_opt_p): Disable tail
>> recursion for instrumented functions with bounded args.
> This sounds wrong. If the builtins are called with a PARAM_DECL rather than
> an SSA_NAME, can't they make worst case assumptions about the bounds?
> In general if we find ourselves disabling an optimizer to make the bounds
> checker happy, we've got some explaining to do.
In SSA we are not allowed to have PARAM_DECL as call arg. The problem
in this optimization is that when we replace a tail call with jump, we
replace default SSA name of input parameter with PHI node holding
taking original param and call's arg. This PHI node then is used in
BUILT_IN_CHKP_ARG_BND, but is should not. Optimizer has to be taught
to analizy bind_bounds of replaced call and generate PHI nodes for
In general for not important optimizations I resolve the stability
issue with instrumented code and will enable optimizations later. For
obviously important optimizations, like inline, support is initially