[Bug debug/67192] Backward-goto in loop can get wrong line number
arnez at linux dot vnet.ibm.com
gcc-bugzilla@gcc.gnu.org
Tue Aug 18 17:16:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67192
--- Comment #7 from Andreas Arnez <arnez at linux dot vnet.ibm.com> ---
(In reply to David Malcolm from comment #3)
> The issue seems to be in here in c_parser_for_statement:
>
> warn_for_misleading_indentation (for_loc, body_loc,
> c_parser_peek_token (parser)->location,
> c_parser_peek_token (parser)->type,
> "for");
>
> where the calls to c_parser_peek_token can lead to input_location being
> changed.
I'm curious why this would lead to the problem seen, and whether that's working
as intended. When looking at c_finish_loop(), I see:
SET_EXPR_LOCATION (t, start_locus);
where t seems to be the GOTO_EXPR for the backward-goto and start_locus is the
location of the beginning of the loop. Naively I would conclude that the
GOTO_EXPR is intended to have the location of the *beginning* of the loop. But
neither before nor after your patch this seems to be the case?
More information about the Gcc-bugs
mailing list