https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108900
--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:8a884140c2bcb738122e71d8d1c680f234de9843 commit r14-11679-g8a884140c2bcb738122e71d8d1c680f234de9843 Author: Jeremy Bettis <jbet...@google.com> Date: Wed Apr 16 21:00:00 2025 -0700 libcpp: Fix incorrect line numbers in large files [PR108900] This patch addresses an issue in the C preprocessor where incorrect line number information is generated when processing files with a large number of lines. The problem arises from improper handling of location intervals in the line map, particularly when locations exceed LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES. By ensuring that the highest location is not decremented if it would move to a different ordinary map, this fix resolves the line number discrepancies observed in certain test cases. This change improves the accuracy of line number reporting, benefiting users relying on precise code coverage and debugging information. Tested x86_64-linux. libcpp/ChangeLog: PR preprocessor/108900 * files.cc (_cpp_stack_file): Do not decrement highest_location across distinct maps. Signed-off-by: Jeremy Bettis <jbet...@google.com> Signed-off-by: Yash Shinde <yash.shi...@windriver.com> (cherry picked from commit d9b56c65a2697e0d7a6c0f15f1977803dc94579b)