]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
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:08:01 +0000 (01:08 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Sat, 27 Nov 2004 01:08:01 +0000 (11:38 +1030)
PR target/12769
* config/rs6000/rs6000.c (init_cumulative_args): Set call_cookie
from rs6000_default_long_calls for libcalls.

From-SVN: r91363

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

index a71d6d9e8117aa7ba1f874c6df17c8dd27cc05dc..aeabbf3e94a447c6febd019870b401edcfa2f413 100644 (file)
@@ -1,5 +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.
+
        PR target/18686
        * config/rs6000/rs6000-c.c (rs6000_pragma_longcall): Use
        integer_zerop and integer_onep instead of comparing against
index a69da98cda3f5c176fcfa3316b128cf64f6c64bd..4e48dffe99903c675b0a4c0d6b8bdd0ec98ec23c 100644 (file)
@@ -252,7 +252,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;
 
@@ -3971,10 +3972,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)
     {