https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78913
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- I should have mentioned: the -Wformat-length pass would benefit from the results of the strlen pass. It would also benefit from better range information. Having the pass run later, after the VRP pass, would improve the range information but I don't think it will help with the string length info. To avoid the warning in this case I suspect the two passes (strlen and sprintf) would either need to communicate (i.e., strlen would need to somehow expose the string length data to subsequent passes similarly to how VRP does via the get_range_info API) or be merged. It's something I'd like to look into in the GCC 8 cycle.