OSDN Git Service

(expand_call): Functions may be const or volatile from their type.
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 1994 12:30:04 +0000 (12:30 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 23 Feb 1994 12:30:04 +0000 (12:30 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@6611 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/calls.c

index 4f3e61b..07588e1 100644 (file)
@@ -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;