On Sun, Oct 16, 2011 at 5:47 PM, Jakub Jelinek <ja...@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  <ja...@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
>

Reply via email to