This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] Small improvements to coverage info (4/n)
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Jul 2019 11:31:42 +0200
- Subject: Re: [patch] Small improvements to coverage info (4/n)
- References: <2735580.mzTH3LooGU@polaris> <8934811.M0zQvRNckR@polaris> <CAFiYyc3qOVVoH3rkrCo4n1VMTWjtirHZkZSSmNHfivNSXEhTJA@mail.gmail.com> <2461618.0oMI5JmTrr@polaris>
On Thu, Jul 11, 2019 at 7:04 PM Eric Botcazou <ebotcazou@adacore.com> wrote:
>
> > After your patch does behavior change when trying to break on a line
> > with a return stmt inside a debugger?
>
> Note that every patch in the series was tested against GDB too, so hopefully
> this would have been caught... But the answer is no, see lower_gimple_return:
>
> /* Generate a goto statement and remove the return statement. */
> found:
> /* When not optimizing, make sure user returns are preserved. */
> if (!optimize && gimple_has_location (stmt))
> DECL_ARTIFICIAL (tmp_rs.label) = 0;
> t = gimple_build_goto (tmp_rs.label);
> /* location includes block. */
> gimple_set_location (t, gimple_location (stmt));
> gsi_insert_before (gsi, t, GSI_SAME_STMT);
> gsi_remove (gsi, false);
>
> So the label, the goto and its location are all preserved:
>
> (gdb) b ops.adb:11
> Breakpoint 1 at 0x40308e: file ops.adb, line 11.
> (gdb) run
> Starting program: /home/eric/gnat/test_ops_okovb
>
> Breakpoint 1, ops.both_ok (a=..., b=...) at ops.adb:11
> 11 return True; -- # ok
>
> (gdb) b ops.adb:14
> Breakpoint 1 at 0x4030c1: file ops.adb, line 14.
> (gdb) run
> Starting program: /home/eric/gnat/test_ops_okovb
>
> Breakpoint 1, ops.both_ok (a=..., b=...) at ops.adb:14
> 14 return False; -- # ko
>
> (gdb) b ops.adb:19
> Breakpoint 1 at 0x403115: file ops.adb, line 19.
> (gdb) run
> Starting program: /home/eric/gnat/test_ops_okovb
>
> Breakpoint 1, ops.both_ok (a=..., b=...) at ops.adb:19
> 19 return False; -- # ov
I see. The patch is OK then.
Thanks,
Richard.
> --
> Eric Botcazou