From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B5C583953D03; Mon, 19 Apr 2021 07:37:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B5C583953D03 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/100142] [11 Regression] ICE in linemap_position_for_loc_and_offset, at libcpp/line-map.c:1004 since r11-8150-g4acb3af3669db4ca Date: Mon, 19 Apr 2021 07:37:41 +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: rguenth at gcc dot gnu.org 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, 19 Apr 2021 07:37:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100142 --- Comment #3 from Richard Biener --- diff --git a/libcpp/line-map.c b/libcpp/line-map.c index 2f5e44447d2..a03d6760a8e 100644 --- a/libcpp/line-map.c +++ b/libcpp/line-map.c @@ -982,7 +982,7 @@ linemap_position_for_loc_and_offset (line_maps *set, the next line map of the set. Otherwise, we try to encode the location in the next map. */ for (; map !=3D LINEMAPS_LAST_ORDINARY_MAP (set) - && (loc + (column << map->m_range_bits) + && (loc + (column_offset << map->m_range_bits) >=3D MAP_START_LOCATION (map + 1)); map++) /* If the next map is a different file, or starts in a higher line, we cannot encode the location there. */ fixes it (pasto in original fix?) and seems to preserve fixing the original= PR (but that had no testcase added).=