From 57d5032b06dc706d2c1801f27ac2788a970e5707 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 13 Feb 2002 12:36:20 -0500 Subject: [PATCH] decl.c (builtin_function): Set TREE_THIS_VOLATILE on return fns. * decl.c (builtin_function): Set TREE_THIS_VOLATILE on return fns. (finish_function): Don't warn if current_function_returns_null. From-SVN: r49738 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/decl.c | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 82f6458ca44c..ac273b146f67 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2002-02-13 Jason Merrill + * decl.c (builtin_function): Set TREE_THIS_VOLATILE on return fns. + (finish_function): Don't warn if current_function_returns_null. + * typeck2.c (digest_init): Do handle values of vector type. * typeck2.c (digest_init, process_init_constructor): Treat vectors diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 158dc8f7c51d..ecc60836f32f 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -6719,6 +6719,10 @@ builtin_function (name, type, code, class, libname) DECL_BUILT_IN_CLASS (decl) = class; DECL_FUNCTION_CODE (decl) = code; + /* The return builtins leave the current function. */ + if (code == BUILT_IN_RETURN || code == BUILT_IN_EH_RETURN) + TREE_THIS_VOLATILE (decl) = 1; + my_friendly_assert (DECL_CONTEXT (decl) == NULL_TREE, 392); /* All builtins that don't begin with an `_' should go in the `std' @@ -14224,7 +14228,7 @@ finish_function (flags) /* Complain if there's just no return statement. */ if (!processing_template_decl && TREE_CODE (TREE_TYPE (fntype)) != VOID_TYPE - && !current_function_returns_value + && !current_function_returns_value && !current_function_returns_null && !DECL_NAME (DECL_RESULT (fndecl)) /* Don't complain if we abort or throw. */ && !current_function_returns_abnormally