aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2004-08-07 12:11:10 -0400
committerJason Merrill <jason@gcc.gnu.org>2004-08-07 12:11:10 -0400
commit5201931ea147af4f55fe47ed879fbef5b3461ef0 (patch)
treeed52c7e668a41a71abd14d2bc80216a67ea6d0f5 /gcc/c-common.c
parent8844a2f541582d58075af46362d57a1f75fc6eff (diff)
downloadgcc-5201931ea147af4f55fe47ed879fbef5b3461ef0.zip
gcc-5201931ea147af4f55fe47ed879fbef5b3461ef0.tar.gz
gcc-5201931ea147af4f55fe47ed879fbef5b3461ef0.tar.bz2
gimplify.c (gimplify_call_expr): Make return in memory explicit.
* gimplify.c (gimplify_call_expr): Make return in memory explicit. (gimplify_modify_expr_rhs): Likewise. * c-common.c (c_warn_unused_result): Check TREE_USED before warning about a CALL_EXPR with an unused value. From-SVN: r85671
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index c3dc4ea..868088f 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -5378,6 +5378,9 @@ c_warn_unused_result (tree *top_p)
break;
case CALL_EXPR:
+ if (TREE_USED (t))
+ break;
+
/* This is a naked call, as opposed to a CALL_EXPR nested inside
a MODIFY_EXPR. All calls whose value is ignored should be
represented like this. Look for the attribute. */