This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: optimization/7189: gcc -O2 -Wall does not print ``controlreaches end of non-void function'' warning


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  <s dot bosscher at student dot tudelft dot nl>

	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 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]