This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: kugan <kugan dot vivekanandarajah at linaro dot org>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Biener <richard dot guenther at gmail dot com>, Jan Hubicka <hubicka at ucw dot cz>, Martin Jambor <mjambor at suse dot cz>
- Date: Fri, 15 Jul 2016 10:42:45 +0200
- Subject: Re: [RFC][IPA-VRP] Disable setting param of __builtin_constant_p to null
- Authentication-results: sourceware.org; auth=none
- References: <57886949.8010300@linaro.org> <57886993.3010901@linaro.org>
> Hi,
>
>
>
> VRP assumes that it is run after inlining. Therefore, if there is a
> call to __builtin_constant_p with function parameter, it resolve it
> to false to avoid bogus warnings. Since we use this as an early vrp
> before inling, it leads to wrong code. As a workaround I have
> disabled it for the time being. That is, this patch is not intended
> for committing but just to get the VRP tested.
>
>
>
> Original patch which introduced this also talks about doing it earlier.
>
>
>
>
>
> Thanks,
>
> Kugan
> >From 99f8e7884d582cfae2d7cb50ad59dab7ac6772fc Mon Sep 17 00:00:00 2001
> From: Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
> Date: Sat, 25 Jun 2016 11:52:57 +1000
> Subject: [PATCH 1/6] Hack-Prevent setting __builtin_constant_p of param to
> null before inlining in Early VRP
>
> ---
> gcc/tree-vrp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c
> index ecfab1f..23c12b5 100644
> --- a/gcc/tree-vrp.c
> +++ b/gcc/tree-vrp.c
> @@ -3759,8 +3759,10 @@ extract_range_basic (value_range *vr, gimple *stmt)
> && SSA_NAME_IS_DEFAULT_DEF (arg)
> && TREE_CODE (SSA_NAME_VAR (arg)) == PARM_DECL)
> {
> +#if 0
> set_value_range_to_null (vr, type);
> return;
> +#endif
It is not cleanest either, but better to test cfun->after_inlining
Honza