[Bug c/59957] libcpp: ICE in read_line_num when re-#define-ing a -DVAR=...

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 27 13:37:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59957

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE in read_line_num when   |libcpp: ICE in
                   |re-#define-ing a -DVAR=...  |read_line_num when
                   |                            |re-#define-ing a -DVAR=...

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The asset in read_line_num is:
   gcc_assert (line_num > 0);

The caller is libcpp/macro.c's:

          if (warned && node->type == NT_MACRO && !(node->flags &
NODE_BUILTIN))
            cpp_error_with_line (pfile, CPP_DL_NOTE,
                                 node->value.macro->line, 0,
                         "this is the location of the previous definition");

where node->value.macro->line == 3 - that only gets converted into line 0 via
gcc/input.c's expand_location_to_spelling_point.



More information about the Gcc-bugs mailing list