https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92462
--- Comment #16 from Wilco <wilco at gcc dot gnu.org> --- (In reply to Richard Biener from comment #15) > I can't find PRE doing anything wrong and on 32bit x86_64 the testcase > executes > correctly with GCC 7.3 and GCC 9 (when I add the missing return to > Bar::cmpxchg). > So -ftree-pre, if it triggers a bug, triggers it elsewhere, the bug isn't in > PRE itself AFAICS. Well the difference is that one of the loads is removed by dse1: **scanning insn=26 cselib lookup (reg/f:SI 102 sfp) => 8:8 cselib lookup (reg/f:SI 126) => 9:4339 cselib lookup (reg/f:SI 102 sfp) => 8:8 cselib lookup (reg/f:SI 102 sfp) => 8:8 cselib lookup (plus:SI (reg/f:SI 102 sfp) (const_int -8 [0xfffffffffffffff8])) => 9:4339 mem: (plus:SI (reg/f:SI 102 sfp) (const_int -8 [0xfffffffffffffff8])) after canon_rtx address: (plus:SI (reg/f:SI 102 sfp) (const_int -8 [0xfffffffffffffff8])) gid=1 offset=-8 processing const load gid=1[-8..-4) trying to replace SImode load in insn 26 from SImode store in insn 16 deferring rescan insn with uid = 26. deferring rescan insn with uid = 77. -- replaced the loaded MEM with (reg 144) mems_found = 0, cannot_delete = true cselib lookup (mem/c:SI (plus:SI (reg/f:SI 102 sfp) (const_int -8 [0xfffffffffffffff8])) [1 curD.6314+0 S4 A64]) => 0:0