This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17544] [4.0 Regression] incorrect -Wunreachable-code warning for mains with a return statement
- 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: 22 Dec 2004 22:34:49 -0000
- Subject: [Bug middle-end/17544] [4.0 Regression] incorrect -Wunreachable-code warning for mains with a return statement
- References: <20040918001720.17544.sebor@roguewave.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From steven at gcc dot gnu dot org 2004-12-22 22:34 -------
Spot the bug:
main ()
{
intD.0 D.1384;
# BLOCK 0, starting at line 3
# PRED: ENTRY
[t.c : 3] D.1384 = 0;
[t.c : 3] goto <bb 2> (<L0>);
# SUCC: 2
# BLOCK 1, starting at line 4
# PRED:
[t.c : 4] D.1384 = 0;
# SUCC: 2
# BLOCK 2
# PRED: 0 1
<L0>:;
return D.1384;
# SUCC: EXIT
}
Note how the compiler generated "return 0;" has a locus. Not giving
it one should fix it.
Testing a patch.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17544