https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107115
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|rtl-optimization |middle-end --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- There are two bugs I think. One in expansion and the other in the RTL optimizers. Without -fno-tree-ter we get: ;; MEM[(long int *)_11] = _12; (nil) And then we don't record the aliasing change. This because we had got: ;; _12 = *_11; ;; MEM[(long int *)_11] = _12; With -fno-tree-ter, we lose it during combine (on the trunk): Trying 16 -> 17: 16: r88:DI=[r87:DI] 17: [r87:DI]=r88:DI REG_DEAD r88:DI REG_DEAD r87:DI Failed to match this instruction: (set (mem:DI (reg/f:DI 87 [ _11 ]) [1 MEM[(long int *)_11]+0 S8 A64]) (mem:DI (reg/f:DI 87 [ _11 ]) [2 *_11+0 S8 A64])) allowing combination of insns 16 and 17 original costs 5 + 4 = 9 replacement cost 5 deferring deletion of insn with uid = 16. modifying insn i3 17: [r87:DI]=[r87:DI] REG_DEAD r87:DI deferring rescan insn with uid = 17. The aliasing set 1 represents `long` and 2 represents `long long` (see the difference there). I don't know what is the best way to represent an aliasing set change even though the value didn't change on the RTL level. This needed for both expand and combine (and maybe a few other places). I should note the Gimple level was fixed for this testcase between GCC 6.2 and GCC 6.3 so it would be interesting to find the patch which fixed that.