This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/67192] [6 Regression] Backward-goto in loop can get wrong line number
- From: "arnez at linux dot vnet.ibm.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 23 Oct 2015 15:32:09 +0000
- Subject: [Bug debug/67192] [6 Regression] Backward-goto in loop can get wrong line number
- Auto-submitted: auto-generated
- References: <bug-67192-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67192
--- Comment #21 from Andreas Arnez <arnez at linux dot vnet.ibm.com> ---
(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.