From 6737ba67d5250258aa08fa779ddac32f8bca6dfb Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 27 Jan 2005 14:36:17 +0000 Subject: re PR middle-end/19583 (Incorrect diagnostic: control may reach end of non-void function '...' being inlined) PR middle-end/19583 * gimple-low.c (try_catch_may_fallthru): New static function. (block_may_fallthru): Handle TRY_CATCH_EXPR. * tree-inline.c (expand_call_inline): Don't warn about reaching the end of a non-void function being inlined if the function uses a return slot. From-SVN: r94323 --- gcc/tree-inline.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/tree-inline.c') diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index 4827fa2..120bab0 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1616,9 +1616,13 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data) id->current_node = edge->callee; copy = copy_body (id); + /* If the function uses a return slot, then it may legitimately + fall through while still returning a value, so we have to skip + the warning here. */ if (warn_return_type && !TREE_NO_WARNING (fn) && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fn))) + && return_slot_addr == NULL_TREE && block_may_fallthru (copy)) { warning ("control may reach end of non-void function %qD being inlined", -- cgit v1.1