https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110963
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Andrew Pinski from comment #1) > Confirmed. > PRE seems to have missed an obvious redundant load here though: Skipping partial redundancy for expression {mem_ref<0B>,addr_expr<&h>}@.MEM_21 (0008), no redundancy on to be optimized for speed edge renaming 'main' into 'bar' fixes this: Found partial redundancy for expression {mem_ref<0B>,addr_expr<&h>}@.MEM_22 (0007) Created phi prephitmp_7 = PHI <_10(11), 0B(6)> in block 7 (0007) ... then the call to 'foo' is eliminated already in FRE5 (before the sinking pass affected by r14-2946-g46c8c225455). IMHO this isn't a bug worth pursuing. Alternatively you can put __attribute__((hot)) on 'main' which we otherwise consider cold. Maybe that's a good idea for future DCE regression searches? Maybe we can consider the special case worthwhile also when optimizing for size.