diff options
author | Richard Guenther <rguenther@suse.de> | 2011-04-08 12:19:45 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-04-08 12:19:45 +0000 |
commit | 9bfc434b7aa052e8d9175d3eca8fc355618e6fab (patch) | |
tree | 77df3037e3807fabf488254798b809e577345502 /gcc/gimple.c | |
parent | 7c1f0b40206bed9fc4b62a04ca9f49c8b9cea4dc (diff) | |
download | gcc-9bfc434b7aa052e8d9175d3eca8fc355618e6fab.zip gcc-9bfc434b7aa052e8d9175d3eca8fc355618e6fab.tar.gz gcc-9bfc434b7aa052e8d9175d3eca8fc355618e6fab.tar.bz2 |
gimple.h (gimple_call_fntype): New function.
2011-04-08 Richard Guenther <rguenther@suse.de>
* gimple.h (gimple_call_fntype): New function.
(gimple_call_return_type): Use it.
* expr.c (expand_expr_real_1): Use gimple_call_fntype.
* gimple-low.c (gimple_check_call_args): Likewise.
* gimple.c (gimple_call_flags): Likewise.
(gimple_call_arg_flags): Likewise.
(gimple_call_return_flags): Likewise.
* tree-cfg.c (verify_gimple_call): Likewise.
(do_warn_unused_result): Likewise.
* tree-ssa-ccp.c (ccp_fold_stmt): Likewise.
* value-prof.c (gimple_ic_transform): Fix fndecl check.
From-SVN: r172178
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 8881aaa..4675d14 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -1780,15 +1780,17 @@ gimple_call_flags (const_gimple stmt) { int flags; tree decl = gimple_call_fndecl (stmt); - tree t; if (decl) flags = flags_from_decl_or_type (decl); else { - t = TREE_TYPE (gimple_call_fn (stmt)); - if (t && TREE_CODE (t) == POINTER_TYPE) - flags = flags_from_decl_or_type (TREE_TYPE (t)); + tree t = TREE_TYPE (gimple_call_fn (stmt)); + /* ??? We can end up being called from gimple_set_modified from + gsi_remove in which case the function being called can + be a released SSA name. Give up in that case. */ + if (t) + flags = flags_from_decl_or_type (gimple_call_fntype (stmt)); else flags = 0; } @@ -1804,7 +1806,7 @@ gimple_call_flags (const_gimple stmt) int gimple_call_arg_flags (const_gimple stmt, unsigned arg) { - tree type = TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt))); + tree type = gimple_call_fntype (stmt); tree attr = lookup_attribute ("fn spec", TYPE_ATTRIBUTES (type)); if (!attr) return 0; @@ -1848,7 +1850,7 @@ gimple_call_return_flags (const_gimple stmt) if (gimple_call_flags (stmt) & ECF_MALLOC) return ERF_NOALIAS; - type = TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt))); + type = gimple_call_fntype (stmt); attr = lookup_attribute ("fn spec", TYPE_ATTRIBUTES (type)); if (!attr) return 0; |