https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82100
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- The FEs don't do static analysis that could detect this and it's incredibly hard to do this during optimization given we'd have to track all instances of code (think of inlining, jump threading duplicating blocks, unrolling, etc.). It might be possible to funnel this kind of warning into one of the very early passes (but even those see inlines).