Hi, memory attributes are currently optimized and attached to RTL even when not optimizing. This is obviously just a wasted effort.
Bootstrapped/regtested x86_64-linux, OK? 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. */