From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 135DD394FC35; Mon, 12 Apr 2021 13:46:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 135DD394FC35 From: "bernd.edlinger at hotmail dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/99446] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1005 since r11-6325 Date: Mon, 12 Apr 2021 13:46:51 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: bernd.edlinger at hotmail dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2021 13:46:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99446 --- Comment #9 from Bernd Edlinger --- The last token is a CPP_PRAGMA_EOL, and has a line number 2, while the include file has only one line, so it is similar to an EOL positi= on. I guess therefore this fails to add a column? 1002 location_t r =3D=20 1003 linemap_position_for_line_and_column (set, map, line, column); 1004 if (linemap_assert_fails (r <=3D set->highest_location) 1005 || linemap_assert_fails (map =3D=3D linemap_lookup (set, r))) 1006 return loc; (gdb) p tok[0] $30 =3D {type =3D CPP_EOF, keyword =3D RID_MAX, flags =3D 64 '@', implicit_= extern_c =3D false, error_reported =3D false,=20 purged_p =3D false, tree_check_p =3D false, main_source_p =3D true, locat= ion =3D 255712, u =3D {tree_check_value =3D 0x0,=20 value =3D 0x0}} (gdb) p tok[-1] $31 =3D {type =3D CPP_PRAGMA_EOL, keyword =3D RID_MAX, flags =3D 0 '\000', implicit_extern_c =3D false, error_reported =3D false,=20 purged_p =3D false, tree_check_p =3D false, main_source_p =3D false, loca= tion =3D 251552, u =3D {tree_check_value =3D 0x0,=20 value =3D 0x0}} location_t r =3D=20 1003 linemap_position_for_line_and_column (set, map, line, column); (gdb) p r $68 =3D 252480 (gdb) p *map $70 =3D { =3D {start_location =3D 251584}, reason =3D LC_LEAVE, s= ysp =3D 0 '\000', m_column_and_range_bits =3D 12,=20 m_range_bits =3D 5, to_file =3D 0x2ac9800 "pr99446-1.h", to_line =3D 2, included_from =3D 238400} (gdb) p *result $74 =3D { =3D {start_location =3D 251616}, reason =3D LC_LEAVE, s= ysp =3D 0 '\000', m_column_and_range_bits =3D 12,=20 m_range_bits =3D 5, to_file =3D 0x2b0a2d0 "pr99446.c", to_line =3D 2, inc= luded_from =3D 0} but line 2 does not exist in both files.=