diff options
| -rw-r--r-- | gcc/ChangeLog | 6 | ||||
| -rw-r--r-- | gcc/tree-inline.c | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 06995dd..3e31b8d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2005-01-17 Ian Lance Taylor <ian@airs.com> + + 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. + 2005-01-17 Mark Dettinger <dettinge@de.ibm.com> * rtlanal.c (rtx_cost): Assign cost of 0 to a SUBREG 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; |
