aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-common.c')
-rw-r--r--gcc/c-common.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c
index bf75fe7..59da62f 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -7546,15 +7546,8 @@ c_warn_unused_result (gimple_seq seq)
/* This is a naked call, as opposed to a GIMPLE_CALL with an
LHS. All calls whose value is ignored should be
represented like this. Look for the attribute. */
- fdecl = gimple_call_fn (g);
- if (TREE_CODE (fdecl) == FUNCTION_DECL)
- ftype = TREE_TYPE (fdecl);
- else
- {
- ftype = TREE_TYPE (fdecl);
- /* Look past pointer-to-function to the function type itself. */
- ftype = TREE_TYPE (ftype);
- }
+ fdecl = gimple_call_fndecl (g);
+ ftype = TREE_TYPE (TREE_TYPE (gimple_call_fn (g)));
if (lookup_attribute ("warn_unused_result", TYPE_ATTRIBUTES (ftype)))
{