Message ID | 201104060857.10184.ebotcazou@adacore.com |
---|---|
State | New |
Headers | show |
On Wed, Apr 6, 2011 at 8:57 AM, Eric Botcazou <ebotcazou@adacore.com> wrote: > Hi, > > this patchlet ensures that return statements are preserved at -O0 so that you > can put a breakpoint on them in the debugger. > > Bootstrapped/regtested on x86_64-suse-linux, OK for the mainline? Ok. Thanks, Richard. > > 2011-04-06 Eric Botcazou <ebotcazou@adacore.com> > > * gimple-low.c (lower_gimple_return): When not optimizing, force > labels associated with user returns to be preserved. > > > 2011-04-06 Eric Botcazou <ebotcazou@adacore.com> > > * gnat.dg/return3.adb: New test. > > > -- > Eric Botcazou >
On Wed, Apr 6, 2011 at 8:57 AM, Eric Botcazou <ebotcazou@adacore.com> wrote: > this patchlet ensures that return statements are preserved at -O0 so that you > can put a breakpoint on them in the debugger. Isn't one of the effects of this patch to generate debug info for the artificial label decl? When I first saw your patch, I thought "FORCED_LABEL()", perhaps I'm not sure that it's any better than your solution... Have you tried that? Ciao! Steven
> Isn't one of the effects of this patch to generate debug info for the > artificial label decl? No, DECL_IGNORED_P is preserved on the label decl. > When I first saw your patch, I thought "FORCED_LABEL()", perhaps I'm > not sure that it's any better than your solution... Have you tried > that? No, that isn't necessary at -O0 IMO, user labels are explicitly preserved.
Index: gimple-low.c =================================================================== --- gimple-low.c (revision 172018) +++ gimple-low.c (working copy) @@ -758,6 +758,9 @@ lower_gimple_return (gimple_stmt_iterato /* 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); gimple_set_location (t, gimple_location (stmt)); gimple_set_block (t, gimple_block (stmt));