This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: optimization/7189: gcc -O2 -Wall does not print ``controlreaches end of non-void function'' warning
- From: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
- To: gcc-gnats at gcc dot gnu dot org, am99173 at konami dot com, gcc-bugs at gcc dot gnu dot org,nobody at gcc dot gnu dot org
- Date: 13 Feb 2003 16:33:14 +0100
- Subject: Re: optimization/7189: gcc -O2 -Wall does not print ``controlreaches end of non-void function'' warning
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7189
This is a sibling call optimization bug.
Without any optimization (gcc -c -Wall), the warning is issued
as it should be. When sibling calls are optimized
(gcc -c -Wall -foptimize-sibling-calls), the warning disappears.
# cat c7129.c
extern void foo(void);
int bar(void) { foo(); }
# gcc-3.4 -v
Reading specs from
/opt/experimental/lib/gcc-lib/i586-pc-linux-gnu/3.4/specs
Configured with: ../gcc-trunk/configure --disable-nls --with-gnu-as
--with-gnu-ld --prefix=/opt/experimental --program-suffix=-3.5
--enable-languages=c,c++
Thread model: posix
gcc version 3.4 20030213 (experimental)
# gcc-3.4 -c -Wall c7189.c
c7189.c: In function `bar':
c7189.c:2: warning: control reaches end of non-void function
# gcc-3.4 -c -Wall c7189.c -foptimize-sibling-calls
#
Greetz
Steven