PR c++/36254 wrong "control reaches end of non-void function" warning
Jakub Jelinek
jakub@redhat.com
Mon Oct 27 12:58:00 GMT 2008
On Mon, Oct 27, 2008 at 11:11:17AM +0100, Manuel López-Ibáñez wrote:
> 2008/10/26 Mark Mitchell <mark@codesourcery.com>:
> > Manuel López-Ibáñez wrote:
> >
> >> 2008-10-23 Manuel López-Ibáñez <manu@gcc.gnu.org>
> >>
> >> PR c++/36254
> >> * gimplify.c (gimplify_expr): Propagate the no_warning flag.
> >> * gimple-low.c (lower_function_body): Propagate the no_warning
> >> flag.
> >
> > What does the comipler-generated code for this testcase look like, and
> > why is it confusing the warning machinery?
>
> See the gimple dump attached. Basically, we surround the whole
> function in try/finally. Then, because flow falls to the end of the
> function, we add a return.
>
> I can attach other dumps if you want, but I think the problem is already here.
The problem is different and you really don't want to play with nowarning
flag. gimple_seq_may_fallthru handles try/finally and try/catch correctly.
The problem is the unnecessary GIMPLE_GOTO after GIMPLE_RETURN which makes
gimple_seq_may_fallthru believe this can fallthru, even if it can't.
I'll have a look.
Jakub
More information about the Gcc-patches
mailing list