From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14855 invoked by alias); 23 Oct 2015 15:32:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 14801 invoked by uid 48); 23 Oct 2015 15:32:12 -0000 From: "arnez at linux dot vnet.ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/67192] [6 Regression] Backward-goto in loop can get wrong line number Date: Fri, 23 Oct 2015 15:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: arnez at linux dot vnet.ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-10/txt/msg01959.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67192 --- Comment #21 from Andreas Arnez --- (In reply to Andreas Arnez from comment #20) > Posted a patch that is not as ambitious as completely getting rid of > input_location, but also doesn't require a new function like > c_parser_peek_token_keep_input_location(): > > https://gcc.gnu.org/ml/gcc-patches/2015-10/msg01132.html After investigating this further I recognized that this patch doesn't cover all cases where the backward-goto is wrongly located. Thus I've created a version that basically follows the suggestion from comment #13, to pass an explicit location to c_finish_loop: https://gcc.gnu.org/ml/gcc-patches/2015-10/msg02393.html I haven't checked whether there are still other cases where add_stmt needs to use input_location as the default location for the given statement. It should probably be one goal to get rid of this default handling.