On Mon, 15 Jun 2015, Jan Hubicka wrote:

> Hi,
> this patch removes last two remaining uses of TYPE_NEEDS_CONSTRUCTING
> in the back-end.  I believe those are remainders from the time we did not
> gimplify as much as we do now. Alias analysis machinery already skips
> checks of TYPE_NEEDS_CONSTRUCTING and thus we need to mark tree correctly
> as non-readonly if it is constructed.

I think it is relevant only for globals anyway, no?  Thus with
unit-at-a-time and global constructors built we should even see it
is not readonly.

> Incrementally I would like to remove TYPE_NEEDS_CONSTRUCTING streaming
> and clear it in free_lang_data.
> 
> Bootstrapped/regtested ppc64le-linux, OK?

Ok.

Thanks,
Richard.

> Honza
> 
>       * ipa-pure-const.c (check_decl): Do not check TYPE_NEEDS_CONSTRUCTING.
>       * tree-inline.c (setup_one_parameter): Likewise.
> Index: ipa-pure-const.c
> ===================================================================
> --- ipa-pure-const.c  (revision 224463)
> +++ ipa-pure-const.c  (working copy)
> @@ -335,7 +335,7 @@
>    if (DECL_EXTERNAL (t) || TREE_PUBLIC (t))
>      {
>        /* Readonly reads are safe.  */
> -      if (TREE_READONLY (t) && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (t)))
> +      if (TREE_READONLY (t))
>       return; /* Read of a constant, do not change the function state.  */
>        else
>       {
> Index: tree-inline.c
> ===================================================================
> --- tree-inline.c     (revision 224463)
> +++ tree-inline.c     (working copy)
> @@ -3151,18 +3151,6 @@
>       automatically replaced by the VAR_DECL.  */
>    insert_decl_map (id, p, var);
>  
> -  /* Even if P was TREE_READONLY, the new VAR should not be.
> -     In the original code, we would have constructed a
> -     temporary, and then the function body would have never
> -     changed the value of P.  However, now, we will be
> -     constructing VAR directly.  The constructor body may
> -     change its value multiple times as it is being
> -     constructed.  Therefore, it must not be TREE_READONLY;
> -     the back-end assumes that TREE_READONLY variable is
> -     assigned to only once.  */
> -  if (TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (p)))
> -    TREE_READONLY (var) = 0;
> -
>    /* If there is no setup required and we are in SSA, take the easy route
>       replacing all SSA names representing the function parameter by the
>       SSA name passed to function.
> 
> 

-- 
Richard Biener <rguent...@suse.de>
SUSE LINUX GmbH, GF: Felix Imendoerffer, Jane Smithard, Dilip Upmanyu, Graham 
Norton, HRB 21284 (AG Nuernberg)

Reply via email to