diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-08-19 05:41:13 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-08-18 22:41:13 -0700 |
commit | 1581a9a177e82ba05a1769eebcf55a038569d6d3 (patch) | |
tree | 768da710870698492b6e6dbb4f9dfcada88d6f73 /gcc | |
parent | c0975bc7053bb733ac32f4079ee1ff29ca24fa43 (diff) | |
download | gcc-1581a9a177e82ba05a1769eebcf55a038569d6d3.zip gcc-1581a9a177e82ba05a1769eebcf55a038569d6d3.tar.gz gcc-1581a9a177e82ba05a1769eebcf55a038569d6d3.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/gimple-low.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/warn/Wreturn-3.C | 18 |
4 files changed, 32 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a706bb2..16ae292 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 3bece1a..5c7c27f 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -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; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1f0c092..c8dfcfb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/warn/Wreturn-3.C b/gcc/testsuite/g++.dg/warn/Wreturn-3.C new file mode 100644 index 0000000..822dd4f --- /dev/null +++ b/gcc/testsuite/g++.dg/warn/Wreturn-3.C @@ -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); +} |