From: Richard Kenner Date: Wed, 23 Feb 1994 12:30:04 +0000 (-0500) Subject: (expand_call): Functions may be const or volatile from their type. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fdff8c6d8831291ce820748667f08eb3b05f1987;p=gcc.git (expand_call): Functions may be const or volatile from their type. From-SVN: r6611 --- diff --git a/gcc/calls.c b/gcc/calls.c index 4f3e61b36d9..07588e14e92 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -555,9 +555,7 @@ expand_call (exp, target, ignore) int old_stack_arg_under_construction; int old_inhibit_defer_pop = inhibit_defer_pop; tree old_cleanups = cleanups_this_call; - rtx use_insns = 0; - register tree p; register int i, j; @@ -569,12 +567,7 @@ expand_call (exp, target, ignore) { fndecl = TREE_OPERAND (p, 0); if (TREE_CODE (fndecl) != FUNCTION_DECL) - { - /* May still be a `const' function if it is - a call through a pointer-to-const. - But we don't handle that. */ - fndecl = 0; - } + fndecl = 0; else { if (!flag_no_inline @@ -603,6 +596,14 @@ expand_call (exp, target, ignore) } } + /* If we don't have specific function to call, see if we have a + constant or `noreturn' function from the type. */ + if (fndecl == 0) + { + is_const = TREE_READONLY (TREE_TYPE (TREE_TYPE (p))); + is_volatile = TREE_THIS_VOLATILE (TREE_TYPE (TREE_TYPE (p))); + } + #ifdef REG_PARM_STACK_SPACE #ifdef MAYBE_REG_PARM_STACK_SPACE reg_parm_stack_space = MAYBE_REG_PARM_STACK_SPACE;