This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug preprocessor/69650] [6 Regression] ICE in linemap_line_start, at libcpp/line-map.c:803


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

--- Comment #14 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #12)
> > This is an invalid linemarker. libcpp should ignore it completely and behave as
> > if it was not present. It seems it is not doing that for some reason and that
> > is messing up the line-table.
> 
> Sure, but I don't see that 1048539 line number anywhere so it feels like
> sth is used uninitialized?

This was thoroughly analyzed by David above. The invalid linemarker causes an
invalid LC_LEAVE which then triggers an invalid line-number calculation.
Somehow, the code for handling the invalid linemarker is doing the wrong thing.

Perhaps this:

to_line = SOURCE_LINE (from, from[1].start_location);

should be

to_line = SOURCE_LINE (from, from->start_location);

But I don't understand what the following comment means (love those cryptic
comments in GCC!)

/* A TO_FILE of NULL is special - we use the natural values.  */
      if (error || to_file == NULL)
        {
          to_file = ORDINARY_MAP_FILE_NAME (from);
          to_line = SOURCE_LINE (from, from[1].start_location);
          sysp = ORDINARY_MAP_IN_SYSTEM_HEADER_P (from);
        }

so it may be trying to do something else besides error-handling.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]