(expand_call): Functions may be const or volatile from their type.
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 23 Feb 1994 12:30:04 +0000 (07:30 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 23 Feb 1994 12:30:04 +0000 (07:30 -0500)
From-SVN: r6611

gcc/calls.c

index 4f3e61b36d9faf4073034799dabcafeee5777f85..07588e14e9229e4d0305abe1af85de5e1c00c29f 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;