This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v3 1/2] [PR debug/67192] Fix C loops' back-jump location
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 05 Nov 2015 12:33:49 +0100
- Subject: Re: [PATCH v3 1/2] [PR debug/67192] Fix C loops' back-jump location
- Authentication-results: sourceware.org; auth=none
- References: <m38u6d211n dot fsf at oc1027705133 dot ibm dot com> <m31tc520ya dot fsf at oc1027705133 dot ibm dot com> <563B1F88 dot 4060508 at redhat dot com>
On Thu, Nov 05 2015, Bernd Schmidt wrote:
> On 11/04/2015 05:17 PM, Andreas Arnez wrote:
>>
>> gcc/c/ChangeLog:
>>
>> PR debug/67192
>> * c-parser.c (c_parser_while_statement): Finish the loop before
>> parsing ahead for misleading indentation.
>> (c_parser_for_statement): Likewise.
>
> This is OK.
Thanks again for reviewing. Are you going to look at patch #2 as well?
> Does C++ have similar issues?
Not this particular issue, AFAIK. But I've just looked at how C++ fares
with the enhanced version of pr67192.c from patch #2. There I see the
following:
Breakpoint 2, f4 () at pr67192.cc:54
(gdb) p cnt
$1 = 16
I.e., when breaking on "while (1)" the first loop iteration has already
executed. This is because the C++ parser assigns the backward-goto to
the 'while' token. It's the same issue you pointed at with version 2 of
my patch.
Shall I open a bug for that?
--
Andreas