FWIW: VAX fix backport and gcc built on 4.3BSD first time ever!

Bernd Schmidt bernds@redhat.com
Thu Dec 21 09:40:00 GMT 2000


On Thu, 14 Dec 2000, Michael Sokolov wrote:

> : Wed Aug 25 01:36:11 1999  John David Anglin  <dave@hiauly1.hia.nrc.ca>
> :
> :         * calls.c (emit_call_1): Use call_pop/call_value_pop for all values
> :         of n_popped when call/call_value are not defined.

I believe that patch is incorrect.

> ! #if defined (HAVE_call) && defined (HAVE_call_value)
> !   if (HAVE_call && HAVE_call_value && HAVE_call_pop && HAVE_call_value_pop
> !        && n_popped > 0)
> ! #else
> !   if (HAVE_call_pop && HAVE_call_value_pop)
> ! #endif

If HAVE_call_value evaluates to 0 (unlikely, but...), it won't emit a call at
all.  I think what's really needed is something like the code below.  Agreed?


Bernd

Index: calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.57
diff -u -p -r1.57 calls.c
--- calls.c	1999/05/08 01:58:39	1.57
+++ calls.c	2000/12/21 17:21:17
@@ -405,7 +405,15 @@ emit_call_1 (funexp, fndecl, funtype, st

 #ifndef ACCUMULATE_OUTGOING_ARGS
 #if defined (HAVE_call_pop) && defined (HAVE_call_value_pop)
-  if (HAVE_call_pop && HAVE_call_value_pop && n_popped > 0)
+/* If the target has "call" or "call_value" insns, then prefer them
+   if no arguments are actually popped.  If the target does not have
+   "call" or "call_value" insns, then we must use the popping versions
+   even if the call has no arguments to pop.  */
+  if (HAVE_call_pop && HAVE_call_value_pop
+#if defined (HAVE_call) && defined (HAVE_call_value)
+      && (n_popped > 0 || ! HAVE_call || ! HAVE_call_value)
+#endif
+      )
     {
       rtx n_pop = GEN_INT (n_popped);
       rtx pat;



More information about the Gcc-patches mailing list