Commit 39b0dce7 by Jason Merrill Committed by Jason Merrill

calls.c (expand_call): Use get_callee_fndecl.

        * calls.c (expand_call): Use get_callee_fndecl.

        * print-tree.c (print_node): Print the chain of an _EXPR.

From-SVN: r33426
parent 89a75b6d
2000-04-26 Jason Merrill <jason@casey.cygnus.com>
* calls.c (expand_call): Use get_callee_fndecl.
* print-tree.c (print_node): Print the chain of an _EXPR.
Tue Apr 25 16:16:04 2000 Andrew MacLeod <amacleod@cygnus.com> Tue Apr 25 16:16:04 2000 Andrew MacLeod <amacleod@cygnus.com>
Jim Wilson <wilson@cygnus.com> Jim Wilson <wilson@cygnus.com>
Andrew Haley <aph@cygnus.com> Andrew Haley <aph@cygnus.com>
......
...@@ -1982,44 +1982,41 @@ expand_call (exp, target, ignore) ...@@ -1982,44 +1982,41 @@ expand_call (exp, target, ignore)
/* See if we can find a DECL-node for the actual function. /* See if we can find a DECL-node for the actual function.
As a result, decide whether this is a call to an integrable function. */ As a result, decide whether this is a call to an integrable function. */
p = TREE_OPERAND (exp, 0); fndecl = get_callee_fndecl (exp);
if (TREE_CODE (p) == ADDR_EXPR) if (fndecl)
{ {
fndecl = TREE_OPERAND (p, 0); if (!flag_no_inline
if (TREE_CODE (fndecl) != FUNCTION_DECL) && fndecl != current_function_decl
fndecl = 0; && DECL_INLINE (fndecl)
else && DECL_SAVED_INSNS (fndecl)
&& DECL_SAVED_INSNS (fndecl)->inlinable)
is_integrable = 1;
else if (! TREE_ADDRESSABLE (fndecl))
{ {
if (!flag_no_inline /* In case this function later becomes inlinable,
&& fndecl != current_function_decl record that there was already a non-inline call to it.
&& DECL_INLINE (fndecl)
&& DECL_SAVED_INSNS (fndecl)
&& DECL_SAVED_INSNS (fndecl)->inlinable)
is_integrable = 1;
else if (! TREE_ADDRESSABLE (fndecl))
{
/* In case this function later becomes inlinable,
record that there was already a non-inline call to it.
Use abstraction instead of setting TREE_ADDRESSABLE Use abstraction instead of setting TREE_ADDRESSABLE
directly. */ directly. */
if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline
&& optimize > 0) && optimize > 0)
{ {
warning_with_decl (fndecl, "can't inline call to `%s'"); warning_with_decl (fndecl, "can't inline call to `%s'");
warning ("called from here"); warning ("called from here");
}
mark_addressable (fndecl);
} }
mark_addressable (fndecl);
flags |= flags_from_decl_or_type (fndecl);
} }
flags |= flags_from_decl_or_type (fndecl);
} }
/* If we don't have specific function to call, see if we have a /* If we don't have specific function to call, see if we have a
attributes set in the type. */ attributes set in the type. */
if (fndecl == 0) else
flags |= flags_from_decl_or_type (TREE_TYPE (TREE_TYPE (p))); {
p = TREE_OPERAND (exp, 0);
flags |= flags_from_decl_or_type (TREE_TYPE (TREE_TYPE (p)));
}
#ifdef REG_PARM_STACK_SPACE #ifdef REG_PARM_STACK_SPACE
#ifdef MAYBE_REG_PARM_STACK_SPACE #ifdef MAYBE_REG_PARM_STACK_SPACE
......
...@@ -613,6 +613,7 @@ print_node (file, prefix, node, indent) ...@@ -613,6 +613,7 @@ print_node (file, prefix, node, indent)
EXPR_WFL_FILENAME (node) : "(no file info)"), EXPR_WFL_FILENAME (node) : "(no file info)"),
EXPR_WFL_LINENO (node), EXPR_WFL_COLNO (node)); EXPR_WFL_LINENO (node), EXPR_WFL_COLNO (node));
} }
print_node (file, "chain", BLOCK_CHAIN (node), indent + 4);
break; break;
case 'c': case 'c':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment