From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17912 invoked by alias); 13 Feb 2003 15:36:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 17887 invoked by uid 71); 13 Feb 2003 15:36:00 -0000 Date: Thu, 13 Feb 2003 15:36:00 -0000 Message-ID: <20030213153600.17885.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Steven Bosscher Subject: Re: optimization/7189: gcc -O2 -Wall does not print ``control reaches end of non-void function'' warning Reply-To: Steven Bosscher X-SW-Source: 2003-02/txt/msg00569.txt.bz2 List-Id: The following reply was made to PR optimization/7189; it has been noted by GNATS. From: Steven Bosscher 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