diff options
author | Ian Lance Taylor <ian@c2micro.com> | 2005-01-27 14:36:17 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2005-01-27 14:36:17 +0000 |
commit | 6737ba67d5250258aa08fa779ddac32f8bca6dfb (patch) | |
tree | c04e5a0433039c3cd49001e6fc91f301c7470db5 /gcc/tree-inline.c | |
parent | 9d72d99675ced5b9f02313c05f01de2a8d03b8d8 (diff) | |
download | gcc-6737ba67d5250258aa08fa779ddac32f8bca6dfb.zip gcc-6737ba67d5250258aa08fa779ddac32f8bca6dfb.tar.gz gcc-6737ba67d5250258aa08fa779ddac32f8bca6dfb.tar.bz2 |
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
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 4 |
1 files changed, 4 insertions, 0 deletions
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", |