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]

[PATCH] PR/14107 Enable -Wreturn-type at -O0


Here it is again. This includes a fix for a band-aid that was included in the C++ front-end (but not in the C front-end).

Paolo
gcc/ChangeLog:
2004-06-29  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/14107
	* tree-optimize.c (init_tree_optimization_passes):
	Run pass_warn_function_return at -O0.

gcc/cp/ChangeLog:
2004-06-29  Paolo Bonzini  <bonzini@gnu.org>

	PR tree-optimization/14107
	* decl.c (finish_function): Remove temporary band-aid.

Index: tree-optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-optimize.c,v
retrieving revision 2.21
diff -u -r2.21 tree-optimize.c
--- tree-optimize.c	23 Jun 2004 20:12:42 -0000	2.21
+++ tree-optimize.c	29 Jun 2004 07:42:06 -0000
@@ -282,6 +282,7 @@
   NEXT_PASS (pass_tree_profile);
   NEXT_PASS (pass_init_datastructures);
   NEXT_PASS (pass_all_optimizations);
+  NEXT_PASS (pass_warn_function_return);
   NEXT_PASS (pass_mudflap_2);
   NEXT_PASS (pass_free_datastructures);
   NEXT_PASS (pass_expand);
@@ -327,7 +328,6 @@
   NEXT_PASS (DUP_PASS (pass_phiopt));
   NEXT_PASS (pass_tail_calls);
   NEXT_PASS (pass_late_warn_uninitialized);
-  NEXT_PASS (pass_warn_function_return);
   NEXT_PASS (pass_del_ssa);
   NEXT_PASS (pass_nrv);
   NEXT_PASS (pass_remove_useless_vars);
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1229
diff -u -r1.1229 decl.c
--- cp/decl.c	27 Jun 2004 03:03:54 -0000	1.1229
+++ cp/decl.c	29 Jun 2004 07:42:07 -0000
@@ -10355,12 +10355,9 @@
       /* Don't complain if we abort or throw.  */
       && !current_function_returns_abnormally
       && !DECL_NAME (DECL_RESULT (fndecl)))
-#if 0
-    /* Enable this for all functions until bug 14107 is fixed properly.  */
       /* Normally, with -Wreturn-type, flow will complain.  Unless we're an
 	 inline function, as we might never be compiled separately.  */
       && (DECL_INLINE (fndecl) || processing_template_decl))
-#endif
     warning ("no return statement in function returning non-void");
 
   /* Store the end of the function, so that we get good line number

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