From 3caf0ca1d3d1c6a65cd2437572992b9bc0a8d067 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Fri, 25 Mar 2016 10:15:39 -0600 Subject: re PR preprocessor/69650 (ICE in linemap_line_start, at libcpp/line-map.c:803) PR lto/69650 * directives.c (do_linemarker): Test for file left but not entered here. * line-map.c (linemap_add): Not here. PR lto/69650 * gcc.dg/pr69650.c: New test. From-SVN: r234481 --- libcpp/directives.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libcpp/directives.c') diff --git a/libcpp/directives.c b/libcpp/directives.c index 63f54ef..6aa6bd1 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -1046,6 +1046,19 @@ do_linemarker (cpp_reader *pfile) skip_rest_of_line (pfile); + if (reason == LC_LEAVE) + { + const line_map_ordinary *from; + if (MAIN_FILE_P (map) + || (new_file + && (from = INCLUDED_FROM (pfile->line_table, map)) != NULL + && filename_cmp (ORDINARY_MAP_FILE_NAME (from), new_file) != 0)) + { + cpp_warning (pfile, CPP_W_NONE, + "file \"%s\" linemarker ignored due to incorrect nesting", new_file); + return; + } + } /* Compensate for the increment in linemap_add that occurs in _cpp_do_file_change. We're currently at the start of the line *following* the #line directive. A separate source_location for this -- cgit v1.1