[Bug c/89410] [7/8/9 Regression] ICE in calculate_line_spans, at diagnostic-show-locus.c:1237 after #line

segher at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 20 18:21:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89410

--- Comment #11 from Segher Boessenkool <segher at gcc dot gnu.org> ---
(In reply to Jonny Grant from comment #9)
> Maybe zero could be disallowed too.

Yes, but maybe we need that for historical reasons.

> Not sure what is best here, I'm not knowledgeable of GCC, but maybe setting
> it to -1 if it goes above, and then never increment again if(-1 == line) ...

The testcase will still ICE then...  The assert is

      /* The spans must be ordered.  */
      gcc_assert (prev->m_first_line < next->m_first_line);


More information about the Gcc-bugs mailing list