From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18313 invoked by alias); 1 Mar 2003 22:56:00 -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 18298 invoked by uid 71); 1 Mar 2003 22:56:00 -0000 Date: Sat, 01 Mar 2003 22:56:00 -0000 Message-ID: <20030301225600.18297.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-03/txt/msg00027.txt.bz2 List-Id: The following reply was made to PR optimization/7189; it has been noted by GNATS. From: Steven Bosscher To: Richard Henderson Cc: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-patches@gcc.gnu.org, nobody@gcc.gnu.org Subject: Re: optimization/7189: gcc -O2 -Wall does not print ``control reaches end of non-void function'' warning Date: 01 Mar 2003 23:55:33 +0100 Op za 01-03-2003, om 01:30 schreef Richard Henderson: > On Thu, Feb 13, 2003 at 10:04:14PM +0100, Steven Bosscher wrote: > > One way to "fix" this bug is to move check_function_return_warnings() up > > to before sibling call optimization in toplev.c, but maybe there's a > > more correct fix? > > I take that back. Moving this to just after > delete_unreachable_blocks should be just fine. I just bootstrapped all except Ada and treelang with the attached patch, regtesting now. OK for mainline and 3.3 if it passes? Greetz Steven 2003-03-01 Steven Bosscher PR optimization/7189 * toplev.c (rest_of_compilation): Move check_function_return_warnings up to just after delete_unreachable_blocks. Index: toplev.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/toplev.c,v retrieving revision 1.725 diff -c -3 -p -r1.725 toplev.c *** toplev.c 1 Mar 2003 01:21:22 -0000 1.725 --- toplev.c 1 Mar 2003 22:43:44 -0000 *************** rest_of_compilation (decl) *** 2625,2630 **** --- 2625,2634 ---- delete_unreachable_blocks (); + /* We have to issue these warnings now already, because CFG cleanups + further down may destroy the required information. */ + check_function_return_warnings (); + /* Turn NOTE_INSN_PREDICTIONs into branch predictions. */ if (flag_guess_branch_prob) { *************** rest_of_compilation (decl) *** 3179,3186 **** open_dump_file (DFI_life, decl); regclass_init (); - - check_function_return_warnings (); #ifdef ENABLE_CHECKING verify_flow_info (); --- 3183,3188 ----