summaryrefslogtreecommitdiff
path: root/gcc/c-common.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-09 17:28:39 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-09 17:28:39 +0000
commit0acacf9e39c2885869ed8cea6b583626b83d13ee (patch)
treee96c21c1520a969a3ed3dd84fdd1dadfb5821f86 /gcc/c-common.c
parent149fead9b9f5a5d9e19ec4e099dde0e40ef6473e (diff)
downloadgcc-0acacf9e39c2885869ed8cea6b583626b83d13ee.tar.gz
2008-08-09 Richard Guenther <rguenther@suse.de>
* gimple.c (gimple_build_call_1): Deal with FUNCTION_DECL fn. * gimple.h (gimple_call_fn): Adjust comment. (gimple_call_set_fndecl): New function. (gimple_call_fndecl): Adjust for GIMPLE_CALL no longer having bare FUNCTION_DECL operand. (gimple_call_return_type): Likewise. * tree-cfg.c (verify_stmt): Verify function operand of a GIMPLE_CALL. * value-prof.c (gimple_divmod_fixed_value): Do not emit labels. (gimple_mod_pow2): Likewise. (gimple_mod_subtract): Likewise. (gimple_ic): Likewise. (gimple_stringop_fixed_value): Likewise. (gimple_indirect_call_to_profile): Fix for GIMPLE_CALL no longer having bare FUNCTION_DECL operand. * ipa-cp.c (ipcp_update_callgraph): Use gimple_call_set_fndecl. * omp-low.c (optimize_omp_library_calls): Likewise. * cgraphunit.c (update_call_expr): Likewise. * tree-ssa-math-opts.c (execute_cse_reciprocals): Likewise. (execute_convert_to_rsqrt): Likewise. * cfgexpand.c (gimple_to_tree): Simplify. (release_stmt_tree): Fix for GIMPLE_CALL no longer having bare FUNCTION_DECL operand. * tree-nested.c (init_tmp_var_with_call): Use gimple_call_return_type. (convert_gimple_call): Use gimple_call_fndecl. * c-common.c (c_warn_unused_result): Likewise. * gcc.dg/tree-ssa/inline-2.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138907 138bc75d-0d04-0410-961f-82ee72b054a4
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 bf75fe78e7b..59da62f7ecc 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)))
{