On Tue, 1 Dec 2015, Jan Hubicka wrote:

> Hi,
> memory attributes are currently optimized and attached to RTL even when not
> optimizing. This is obviously just a wasted effort.

Huh, are you sure?  What about globals used from different optimize
contexts?

> Bootstrapped/regtested x86_64-linux, OK?

I don't think so.  Did you bootstrap with BOOT_CFLAGS="-O0 -g"?

Richard.

> Honza
>       * emit-rtl.c (set_mem_attrs, set_mem_attributes_minus_bitpos):
>       Do not compute memory attributes when not optimizing.
> 
> Index: emit-rtl.c
> ===================================================================
> --- emit-rtl.c        (revision 231081)
> +++ emit-rtl.c        (working copy)
> @@ -336,7 +336,8 @@ static void
>  set_mem_attrs (rtx mem, mem_attrs *attrs)
>  {
>    /* If everything is the default, we can just clear the attributes.  */
> -  if (mem_attrs_eq_p (attrs, mode_mem_attrs[(int) GET_MODE (mem)]))
> +  if (!optimize
> +      || mem_attrs_eq_p (attrs, mode_mem_attrs[(int) GET_MODE (mem)]))
>      {
>        MEM_ATTRS (mem) = 0;
>        return;
> @@ -1749,6 +1750,9 @@ set_mem_attributes_minus_bitpos (rtx ref
>    struct mem_attrs attrs, *defattrs, *refattrs;
>    addr_space_t as;
>  
> +  if (!optimize)
> +    return;
> +
>    /* It can happen that type_for_mode was given a mode for which there
>       is no language-level type.  In which case it returns NULL, which
>       we can see here.  */
> 
> 

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

Reply via email to