https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61672
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2014-08-04 Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 33237 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33237&action=edit patch Ok, I see stuff like the following in the 179r.pre dump differences @@ -1524,6 +1524,11 @@ Loads : (insn_list:REG_DEP_TRUE 21 (nil)) Stores : (nil) + Pattern ( 0): (mem/f:SI (plus:SI (reg/v/f:SI 93 [ pfile ]) + (const_int 12 [0xc])) [3 pfile_5(D)->u_buff+0 S4 A32]) + Loads : (insn_list:REG_DEP_TRUE 19 (nil)) + Stores : (nil) + Pattern ( 0): (mem/f:SI (plus:SI (reg/v/f:SI 83 [ buff ]) (const_int 12 [0xc])) [3 buff_6->limit+0 S4 A32]) Loads : (insn_list:REG_DEP_TRUE 9 (nil)) @@ -1536,11 +1541,11 @@ Pattern ( 0): (mem/f:SI (plus:SI (reg/v/f:SI 93 [ pfile ]) (const_int 12 [0xc])) [3 pfile_5(D)->u_buff+0 S4 A32]) - Loads : (insn_list:REG_DEP_TRUE 19 (insn_list:REG_DEP_TRUE 7 (nil))) + Loads : (insn_list:REG_DEP_TRUE 7 (nil)) Stores : (nil) Ah, gcse ends up calling exp_equiv_p which does /* Can't merge two expressions in different alias sets, since we can decide that the expression is transparent in a block when it isn't, due to it being set with the different alias set. Also, can't merge two expressions with different MEM_ATTRS. They could e.g. be two different entities allocated into the same space on the stack (see e.g. PR25130). In that case, the MEM addresses can be the same, even though the two MEMs are absolutely not equivalent. But because really all MEM attributes should be the same for equivalent MEMs, we just use the invariant that MEMs that have the same attributes share the same mem_attrs data structure. */ if (MEM_ATTRS (x) != MEM_ATTRS (y)) return 0; cfgcleanup.c has similar code. Untested fix attached, with this we create the same code for the pr58464 testcase.