]> gcc.gnu.org Git - gcc.git/commitdiff
semantics.c (genrtl_finish_function): Don't init or check can_reach_end; remove noret...
authorRichard Henderson <rth@cygnus.com>
Fri, 6 Oct 2000 06:00:59 +0000 (23:00 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Fri, 6 Oct 2000 06:00:59 +0000 (23:00 -0700)
        * semantics.c (genrtl_finish_function): Don't init or check
        can_reach_end; remove noreturn and return value checks.

From-SVN: r36749

gcc/cp/ChangeLog
gcc/cp/semantics.c

index 23e16de16a4a0ea90932f65ab66106ce76c44742..cea08bdb58c6cc01710ad1a898961e185c0dfbaa 100644 (file)
@@ -1,3 +1,8 @@
+2000-10-05  Richard Henderson  <rth@cygnus.com>
+
+       * semantics.c (genrtl_finish_function): Don't init or check
+       can_reach_end; remove noreturn and return value checks.
+
 2000-10-05  Tom Tromey  <tromey@cygnus.com>
 
        * init.c (build_java_class_ref): Use `build_static_name' with a
index 5c5756775e8f4da1eb95946a1810aaa48b3c4e55..e3d1dec952d841dbb6e43b3882f1157d23dd0b6e 100644 (file)
@@ -2528,8 +2528,6 @@ static void
 genrtl_finish_function (fn)
      tree fn;
 {
-  int returns_null;
-  int returns_value;
   tree no_return_label = NULL_TREE;
 
 #if 0
@@ -2630,14 +2628,6 @@ genrtl_finish_function (fn)
   /* Generate rtl for function exit.  */
   expand_function_end (input_filename, lineno, 1);
 
-  /* So we can tell if jump_optimize sets it to 1.  */
-  can_reach_end = 0;
-
-  /* Before we call rest_of_compilation (which will pop the
-     CURRENT_FUNCTION), we must save these values.  */
-  returns_null = current_function_returns_null;
-  returns_value = current_function_returns_value;
-
   /* If this is a nested function (like a template instantiation that
      we're compiling in the midst of compiling something else), push a
      new GC context.  That will keep local variables on the stack from
@@ -2684,25 +2674,6 @@ genrtl_finish_function (fn)
   if (DECL_STATIC_DESTRUCTOR (fn))
     static_dtors = tree_cons (NULL_TREE, fn, static_dtors);
 
-  if (DECL_NAME (DECL_RESULT (fn)))
-    returns_value |= can_reach_end;
-  else
-    returns_null |= can_reach_end;
-
-  if (TREE_THIS_VOLATILE (fn) && returns_null)
-    warning ("`noreturn' function does return");
-  else if (returns_null
-          && TREE_CODE (TREE_TYPE (TREE_TYPE (fn))) != VOID_TYPE)
-    {
-      /* Always complain if there's just no return statement.  */
-      if (!returns_value)
-       warning ("no return statement in function returning non-void");
-      else if (warn_return_type || pedantic)
-       /* If this function returns non-void and control can drop through,
-              complain.  */
-       warning ("control reaches end of non-void function");
-    }
-
   --function_depth;
 
   if (!DECL_SAVED_INSNS (fn)
This page took 0.076946 seconds and 5 git commands to generate.