https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118521
Jeffrey A. Law <law at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rguenth at gcc dot gnu.org --- Comment #8 from Jeffrey A. Law <law at gcc dot gnu.org> --- So adding a bit more. It's not until SCCP is done that things simplify enough that the problematical path can be relatively easily shown to be unreachable. The most likely candidates to clean that up after SCCP are: FRE (5) and DOM (3). DOM (3) is the last chance we have before strlen runs which issues the warning. In both FRE and DOM we have this (or something very close): ; basic block 5, loop depth 0, count 131235112 (estimated locally, freq 1.0000), maybe hot ;; prev block 4, next block 6, flags: (NEW, REACHABLE, VISITED) ;; pred: 3 [always] count:131235111 (estimated locally, freq 1.0000) (FALLTHRU,EXECUTABLE) _90 = _143 + 2; __builtin_memset (_90, 0, 2); MEM <unsigned short> [(char * {ref-all})_143] = 513; __result_188 = _143 + 1; __new_finish_99 = __result_188 + 3; operator delete (_46, 2); _108 = _143 + 4; if (__new_finish_99 != _108) goto <bb 6>; [82.57%] else goto <bb 7>; [17.43%] FRE probably has a better chance here. Thoughts Richi?