From 63c16fc50c5cf446269da98919ccc7016bd4498f Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Thu, 5 Oct 2000 23:00:59 -0700 Subject: [PATCH] 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 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/semantics.c | 29 ----------------------------- 2 files changed, 5 insertions(+), 29 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 23e16de16a4a..cea08bdb58c6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-10-05 Richard Henderson + + * semantics.c (genrtl_finish_function): Don't init or check + can_reach_end; remove noreturn and return value checks. + 2000-10-05 Tom Tromey * init.c (build_java_class_ref): Use `build_static_name' with a diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 5c5756775e8f..e3d1dec952d8 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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) -- 2.43.5