This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/69650] [6 Regression] ICE in linemap_line_start, at libcpp/line-map.c:803
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Mar 2016 11:10:11 +0000
- Subject: [Bug preprocessor/69650] [6 Regression] ICE in linemap_line_start, at libcpp/line-map.c:803
- Auto-submitted: auto-generated
- References: <bug-69650-4 at http dot gcc dot gnu dot org/bugzilla/>
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.