This is the mail archive of the
gcc-prs@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: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 13 Feb 2003 15:36:00 -0000
- Subject: Re: optimization/7189: gcc -O2 -Wall does not print ``controlreaches end of non-void function'' warning
- Reply-to: Steven Bosscher <s dot bosscher at student dot tudelft dot nl>
The following reply was made to PR optimization/7189; it has been noted by GNATS.
From: Steven Bosscher <s.bosscher@student.tudelft.nl>
To: gcc-gnats@gcc.gnu.org, am99173@konami.com, gcc-bugs@gcc.gnu.org,
nobody@gcc.gnu.org
Cc:
Subject: Re: optimization/7189: gcc -O2 -Wall does not print ``control
reaches end of non-void function'' warning
Date: 13 Feb 2003 16:33:14 +0100
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