This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Clear DECL_GIMPLE_REG_P when making parameter copy addressable (PR tree-optimization/50735)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 17 Oct 2011 08:49:34 +0200
- Subject: Re: [PATCH] Clear DECL_GIMPLE_REG_P when making parameter copy addressable (PR tree-optimization/50735)
- References: <20111016154704.GI2210@tyan-ft48-01.lab.bos.redhat.com>
On Sun, Oct 16, 2011 at 5:47 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> Hi!
>
> gimplify_parameters uses create_tmp_reg, but sometimes it decides to make
> it addressable (if the PARM_DECL is addressable). ?If so, it must not be
> DECL_GIMPLE_REG_P.
>
> Alternatively we could call create_tmp_reg only if !TREE_ADDRESSABLE and
> call create_tmp_var instead for TREE_ADDRESSABLE (+ set TREE_ADDRESSABLE).
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
I think this should be exactly the other way around, using create_tmp_var,
copying TREE_ADDRESSABLE and setting DECL_GIMPLE_REG_P if it is not addressable.
Ok with that change.
Thanks,
Richard.
> 2011-10-16 ?Jakub Jelinek ?<jakub@redhat.com>
>
> ? ? ? ?PR tree-optimization/50735
> ? ? ? ?* function.c (gimplify_parameters): When making local TREE_ADDRESSABLE,
> ? ? ? ?also clear DECL_GIMPLE_REG_P.
>
> --- gcc/function.c.jj ? 2011-10-14 08:21:56.000000000 +0200
> +++ gcc/function.c ? ? ?2011-10-15 12:43:23.000000000 +0200
> @@ -3624,7 +3624,10 @@ gimplify_parameters (void)
> ? ? ? ? ? ? ? ? ? ? not the PARMs. ?Keep the parms address taken
> ? ? ? ? ? ? ? ? ? ? as we'll query that flag during gimplification. ?*/
> ? ? ? ? ? ? ? ? ?if (TREE_ADDRESSABLE (parm))
> - ? ? ? ? ? ? ? ? ? TREE_ADDRESSABLE (local) = 1;
> + ? ? ? ? ? ? ? ? ? {
> + ? ? ? ? ? ? ? ? ? ? TREE_ADDRESSABLE (local) = 1;
> + ? ? ? ? ? ? ? ? ? ? DECL_GIMPLE_REG_P (local) = 0;
> + ? ? ? ? ? ? ? ? ? }
> ? ? ? ? ? ? ? ?}
> ? ? ? ? ? ? ?else
> ? ? ? ? ? ? ? ?{
>
> ? ? ? ?Jakub
>