aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@cygnus.com>2000-10-05 23:01:27 -0700
committerRichard Henderson <rth@gcc.gnu.org>2000-10-05 23:01:27 -0700
commitb313a0fe15d7f5953f87141c49786a8eccb90683 (patch)
tree2a84a351f2dd9e081499cea34c0929d359328dd0 /gcc/c-decl.c
parent63c16fc50c5cf446269da98919ccc7016bd4498f (diff)
downloadgcc-b313a0fe15d7f5953f87141c49786a8eccb90683.zip
gcc-b313a0fe15d7f5953f87141c49786a8eccb90683.tar.gz
gcc-b313a0fe15d7f5953f87141c49786a8eccb90683.tar.bz2
c-decl.c (warn_missing_noreturn): Remove.
* c-decl.c (warn_missing_noreturn): Remove. (c_expand_body): Don't set or check can_reach_end. * c-tree.h (warn_missing_noreturn): Move ... * flags.h: ... here. (can_reach_end): Remove. * flow.c (check_function_return_warnings): New. (make_edges): No edge to exit for noreturn sibcalls. * function.c (expand_function_end): Save the return value clobber instruction. (mark_function_status): Mark it. * function.h (struct function): Add x_clobber_return_insn. * jump.c (can_reach_end): Remove. (calculate_can_reach_end): Remove. (jump_optimize_1): Don't call it. * output.h (check_function_return_warnings): Declare. * toplev.c (warn_missing_noreturn): Move from c-decl.c (rest_of_compilation): Call check_function_return_warnings. From-SVN: r36750
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 940d4b1..9dbaa28 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -403,10 +403,6 @@ int warn_cast_qual;
int warn_bad_function_cast;
-/* Warn about functions which might be candidates for attribute noreturn. */
-
-int warn_missing_noreturn;
-
/* Warn about traditional constructs whose meanings changed in ANSI C. */
int warn_traditional;
@@ -6760,9 +6756,6 @@ c_expand_body (fndecl, nested_p)
/* Generate rtl for function exit. */
expand_function_end (input_filename, lineno, 0);
- /* So we can tell if jump_optimize sets it to 1. */
- can_reach_end = 0;
-
/* If this is a nested function, protect the local variables in the stack
above us from being collected while we're compiling this function. */
if (nested_p)
@@ -6775,25 +6768,11 @@ c_expand_body (fndecl, nested_p)
if (nested_p)
ggc_pop_context ();
- current_function_returns_null |= can_reach_end;
-
- if (warn_missing_noreturn
- && !TREE_THIS_VOLATILE (fndecl)
- && !current_function_returns_null
- && !current_function_returns_value)
- warning ("function might be possible candidate for attribute `noreturn'");
-
- if (TREE_THIS_VOLATILE (fndecl) && current_function_returns_null)
- warning ("`noreturn' function does return");
- else if (warn_return_type && can_reach_end
- && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl))))
- /* If this function returns non-void and control can drop through,
- complain. */
- warning ("control reaches end of non-void function");
/* With just -W, complain only if function returns both with
and without a value. */
- else if (extra_warnings
- && current_function_returns_value && current_function_returns_null)
+ if (extra_warnings
+ && current_function_returns_value
+ && current_function_returns_null)
warning ("this function may return with or without a value");
/* If requested, warn about function definitions where the function will