This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20624] [4.0/4.1 Regression] wrong "control reaches end of non-void function" warning
- From: "steven at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Aug 2005 21:47:31 -0000
- Subject: [Bug c++/20624] [4.0/4.1 Regression] wrong "control reaches end of non-void function" warning
- References: <20050324162738.20624.oliverst@online.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2005-08-17 21:47 -------
FYI, this is the CFG for the test case of comment #13 at the point where
the warning is issued:
fpos seekoff(int, int) (b, c)
{
int finally_tmp.0;
struct g __buf;
struct fpos D.2120;
struct fpos D.2119;
struct fpos D.2123;
# BLOCK 0
# PRED: ENTRY (fallthru)
__comp_ctor (&__buf);
if (b == -1) goto <L2>; else goto <L0>;
# SUCC: 3 (true) 1 (false)
# BLOCK 1
# PRED: 0 (false)
<L0>:;
if (c < 0) goto <L2>; else goto <L1>;
# SUCC: 3 (true) 2 (false)
# BLOCK 2
# PRED: 1 (false)
<L1>:;
__comp_ctor (&D.2119, -1);
D.2123 = D.2119;
finally_tmp.0 = 0;
goto <bb 4> (<L4>);
# SUCC: 4 (fallthru)
# BLOCK 3
# PRED: 0 (true) 1 (true)
<L2>:;
__comp_ctor (&D.2120, -1);
D.2123 = D.2120;
finally_tmp.0 = 0;
# SUCC: 4 (fallthru)
# BLOCK 4
# PRED: 2 (fallthru) 3 (fallthru)
<L4>:;
__comp_dtor (&__buf);
switch (finally_tmp.0)
{
case 1: goto <L5>;
default : goto <L6>;
}
# SUCC: 5 6
# BLOCK 5
# PRED: 4
<L5>:;
return;
# SUCC: EXIT
# BLOCK 6
# PRED: 4
<L6>:;
return D.2123;
# SUCC: EXIT
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20624