aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-02-23 07:30:04 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-02-23 07:30:04 -0500
commitfdff8c6d8831291ce820748667f08eb3b05f1987 (patch)
tree3077b8d8bd0b75b794bad3757cdae8b37fae92c7 /gcc
parenta0b25e45b7a2e2b816055f853ecebb1c28a3b8e0 (diff)
downloadgcc-fdff8c6d8831291ce820748667f08eb3b05f1987.zip
gcc-fdff8c6d8831291ce820748667f08eb3b05f1987.tar.gz
gcc-fdff8c6d8831291ce820748667f08eb3b05f1987.tar.bz2
(expand_call): Functions may be const or volatile from their type.
From-SVN: r6611
Diffstat (limited to 'gcc')
-rw-r--r--gcc/calls.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 4f3e61b..07588e1 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;