Jeremy Bettis <jbet...@google.com> writes:

> Patch to fix known bug from
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108900
>
> diff -ur gcc-clean/gcc-14.2.0/libcpp/files.cc gcc-14.2.0/libcpp/files.cc
> --- gcc-clean/gcc-14.2.0/libcpp/files.cc 2024-08-01 08:17:17.000000000 +0000
> +++ gcc-14.2.0/libcpp/files.cc 2024-10-18 18:42:42.293245597 +0000

Please ideally use git-send-email and see
https://gcc.gnu.org/contribute.html#patches wrt ChangeLog format and so on.

> @@ -1005,6 +1005,11 @@
>      && type < IT_DIRECTIVE_HWM
>      && (pfile->line_table->highest_location
>   != LINE_MAP_MAX_LOCATION - 1));
> +  if (decrement && LINEMAPS_ORDINARY_USED (pfile->line_table)) {
> +    const line_map_ordinary *map = LINEMAPS_LAST_ORDINARY_MAP
> (pfile->line_table);
> +    if (map && map->start_location == pfile->line_table->highest_location)
> +      decrement = false;
> +  }
>    if (decrement)
>      pfile->line_table->highest_location--;

Note that I suspect this may be fixed by the 64-bit location_t work that
is ongoing for trunk but it may still be desirable for 14 anyway.

Reply via email to