decl.c (builtin_function): Set TREE_THIS_VOLATILE on return fns.
authorJason Merrill <jason@redhat.com>
Wed, 13 Feb 2002 17:36:20 +0000 (12:36 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 13 Feb 2002 17:36:20 +0000 (12:36 -0500)
        * 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
gcc/cp/decl.c

index 82f6458ca44c63275971ebb1c8deec47a55a0874..ac273b146f67edfe7a61af7fd1f315b1010b5dc7 100644 (file)
@@ -1,5 +1,8 @@
 2002-02-13  Jason Merrill  <jason@redhat.com>
 
+       * 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
index 158dc8f7c51def77ff2da8844a46c0ffc59da685..ecc60836f32fd521ada0dc0effd8c94e771082d2 100644 (file)
@@ -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