[Bug c++/36254] wrong "control reaches end of non-void function" warning

manu at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Oct 27 14:36:00 GMT 2008



------- Comment #11 from manu at gcc dot gnu dot org  2008-10-27 14:35 -------
(In reply to comment #10)
> Language specific tree codes are allowed until the gimplification is done,
> the cp_gimplify_expr langhook takes care of either rewriting the lang specific
> tree code into GENERIC (COND_EXPR in this case), or tuplifying it right away.

If they are permitted, they should be handled. If they are not handled, we
should fail to compile or crash. Currently we just ignore them, which works ok
for C since generic is basically C but fails for everything else.

> BTW, looking at the other testcase, block_may_fallthru certainly isn't able
> to say whether a SWITCH_EXPR can fall thru or not, and it wouldn't be actually
> very easy.  So perhaps we either need to run some pass that kills obvious dead
> code before reporting the "control reaches end" warnings, or really try harder
> during gimplification to figure out these cases and optimize it at that point.

So basically you propose to do optimizations at -O0. I still do not understand
what is the problem with setting no_warning. This is *really*
compiler-generated code.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36254



More information about the Gcc-bugs mailing list