re PR c++/20624 (wrong "control reaches end of non-void function" warning)

2005-08-19  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/20624
        * g++.dg/warn/Wreturn-3.C: New test

2005-08-19  Andrew Pinski  <pinskia@physics.uc.edu>

        PR middle-end/20624
        * gimple-low.c (block_may_fallthru): Handle CLEANUP_POINT_EXPR by
        looking past it.

From-SVN: r103268
This commit is contained in:
Andrew Pinski 2005-08-19 05:41:13 +00:00 committed by Andrew Pinski
parent c0975bc705
commit 1581a9a177
4 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2005-08-19 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/20624
* gimple-low.c (block_may_fallthru): Handle CLEANUP_POINT_EXPR by
looking past it.
2005-08-18 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* collect2.c (dup2): Delete.

View File

@ -368,6 +368,9 @@ block_may_fallthru (tree block)
case CALL_EXPR:
/* Functions that do not return do not fall through. */
return (call_expr_flags (stmt) & ECF_NORETURN) == 0;
case CLEANUP_POINT_EXPR:
return block_may_fallthru (TREE_OPERAND (stmt, 0));
default:
return true;

View File

@ -1,3 +1,8 @@
2005-08-19 Andrew Pinski <pinskia@physics.uc.edu>
PR middle-end/20624
* g++.dg/warn/Wreturn-3.C: New test
2005-08-18 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/22228

View File

@ -0,0 +1,18 @@
// { dg-options "-Wreturn-type" }
// PR c++/20624
struct fpos {
fpos(int __pos) {}
};
struct g {
g();
~g();
};
fpos seekoff(int b, int c)
{
g __buf;
if (b != -1 && c >= 0)
return fpos(-1);
else
return fpos(-1);
}