diff options
author | Ian Lance Taylor <ian@airs.com> | 2005-01-17 17:12:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2005-01-17 17:12:27 +0000 |
commit | 81bafd3637c9563715680b98fae7009ff7809a6f (patch) | |
tree | 7a12b81ccffc8763df53da42cf1c649efcd53cc5 /gcc/tree-inline.c | |
parent | edb8116590f8811fd2f83f5144cbe3a9d0b6b3e8 (diff) | |
download | gcc-81bafd3637c9563715680b98fae7009ff7809a6f.zip gcc-81bafd3637c9563715680b98fae7009ff7809a6f.tar.gz gcc-81bafd3637c9563715680b98fae7009ff7809a6f.tar.bz2 |
re PR middle-end/13127 (Inlining causes spurious "might be used uninitialized" warnings)
PR middle-end/13127:
* tree-inline.c (expand_call_inline): Set TREE_NO_WARNING on
a variable set to the return value of the inlined function.
From-SVN: r93765
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r-- | gcc/tree-inline.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index b6ad399..a72485c 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1580,7 +1580,18 @@ expand_call_inline (tree *tp, int *walk_subtrees, void *data) /* Find the lhs to which the result of this call is assigned. */ modify_dest = tsi_stmt (id->tsi); if (TREE_CODE (modify_dest) == MODIFY_EXPR) - modify_dest = TREE_OPERAND (modify_dest, 0); + { + modify_dest = TREE_OPERAND (modify_dest, 0); + + /* The function which we are inlining might not return a value, + in which case we should issue a warning that the function + does not return a value. In that case the optimizers will + see that the variable to which the value is assigned was not + initialized. We do not want to issue a warning about that + uninitialized variable. */ + if (DECL_P (modify_dest)) + TREE_NO_WARNING (modify_dest) = 1; + } else modify_dest = NULL; |