re PR middle-end/12769 (-mlongcall doesn't convert all calls to long calls for builti...
authorAlan Modra <amodra@bigpond.net.au>
Sat, 27 Nov 2004 01:06:55 +0000 (01:06 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Sat, 27 Nov 2004 01:06:55 +0000 (11:36 +1030)
PR target/12769
* config/rs6000/rs6000.c (init_cumulative_args): Set call_cookie
from rs6000_default_long_calls for libcalls.

From-SVN: r91362

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index 3ec691ebf7e472c3595274777eb9e9e857ada4b3..857aa8f10539fa9bef3c5ffdae3f2b886307c7c6 100644 (file)
@@ -1,3 +1,9 @@
+2004-11-27  Alan Modra  <amodra@bigpond.net.au>
+
+       PR target/12769
+       * config/rs6000/rs6000.c (init_cumulative_args): Set call_cookie
+       from rs6000_default_long_calls for libcalls.
+
 2004-11-26  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
 
        * expmed.c (extract_bit_field): When extracting from non-integer mode,
index 5511e4b71abe13ac7381945456fbb76b748a914b..b7deebb000068a25e14cb34cd4dd9779237f9d54 100644 (file)
@@ -278,7 +278,8 @@ static GTY(()) int rs6000_sr_alias_set;
 /* Call distance, overridden by -mlongcall and #pragma longcall(1).
    The only place that looks at this is rs6000_set_default_type_attributes;
    everywhere else should rely on the presence or absence of a longcall
-   attribute on the function declaration.  */
+   attribute on the function declaration.  Exception: init_cumulative_args
+   looks at it too, for libcalls.  */
 int rs6000_default_long_calls;
 const char *rs6000_longcall_switch;
 
@@ -4699,10 +4700,11 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
     cum->nargs_prototype = n_named_args;
 
   /* Check for a longcall attribute.  */
-  if (fntype
-      && lookup_attribute ("longcall", TYPE_ATTRIBUTES (fntype))
-      && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype)))
-    cum->call_cookie = CALL_LONG;
+  if ((!fntype && rs6000_default_long_calls)
+      || (fntype
+         && lookup_attribute ("longcall", TYPE_ATTRIBUTES (fntype))
+         && !lookup_attribute ("shortcall", TYPE_ATTRIBUTES (fntype))))
+    cum->call_cookie |= CALL_LONG;
 
   if (TARGET_DEBUG_ARG)
     {