Commit 63c16fc5 by Richard Henderson Committed by Richard Henderson

semantics.c (genrtl_finish_function): Don't init or check can_reach_end; remove…

semantics.c (genrtl_finish_function): Don't init or check can_reach_end; remove noreturn and return value checks.

        * semantics.c (genrtl_finish_function): Don't init or check
        can_reach_end; remove noreturn and return value checks.

From-SVN: r36749
parent 9cc37c9f
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> 2000-10-05 Tom Tromey <tromey@cygnus.com>
* init.c (build_java_class_ref): Use `build_static_name' with a * init.c (build_java_class_ref): Use `build_static_name' with a
......
...@@ -2528,8 +2528,6 @@ static void ...@@ -2528,8 +2528,6 @@ static void
genrtl_finish_function (fn) genrtl_finish_function (fn)
tree fn; tree fn;
{ {
int returns_null;
int returns_value;
tree no_return_label = NULL_TREE; tree no_return_label = NULL_TREE;
#if 0 #if 0
...@@ -2630,14 +2628,6 @@ genrtl_finish_function (fn) ...@@ -2630,14 +2628,6 @@ genrtl_finish_function (fn)
/* Generate rtl for function exit. */ /* Generate rtl for function exit. */
expand_function_end (input_filename, lineno, 1); 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 /* If this is a nested function (like a template instantiation that
we're compiling in the midst of compiling something else), push a we're compiling in the midst of compiling something else), push a
new GC context. That will keep local variables on the stack from new GC context. That will keep local variables on the stack from
...@@ -2684,25 +2674,6 @@ genrtl_finish_function (fn) ...@@ -2684,25 +2674,6 @@ genrtl_finish_function (fn)
if (DECL_STATIC_DESTRUCTOR (fn)) if (DECL_STATIC_DESTRUCTOR (fn))
static_dtors = tree_cons (NULL_TREE, fn, static_dtors); 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; --function_depth;
if (!DECL_SAVED_INSNS (fn) if (!DECL_SAVED_INSNS (fn)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment