aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@c2micro.com>2005-01-27 14:36:17 +0000
committerIan Lance Taylor <ian@c2micro.com>2005-01-27 14:36:17 +0000
commit8c9f6e8bc2513b6d6f005da06ab358efe703d99e (patch)
treec04e5a0433039c3cd49001e6fc91f301c7470db5 /gcc/tree-inline.c
parent12950577fa5e954180aa604ad93063793a1c3701 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@94323 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 4827fa20358..120bab0fb21 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",