This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Telling the type of a libcall
- To: gcc-patches at gcc dot gnu dot org
- Subject: Telling the type of a libcall
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 05 Jan 2001 02:45:05 -0200
- Organization: GCC Team, Red Hat
Currently, there's no way for INIT_CUMMULATIVE_ARGS to know the return
type of a libcall, because it gets NULL for the FNTYPE. I happen to
need to know what type a libcall is going to return, so I propose this
patch. Ok to install?
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* calls.c (emit_library_call_value_1): Support
INIT_CUMULATIVE_LIBCALL_ARGS.
* tm.texi (INIT_CUMULATIVE_LIBCALL_ARGS): Document it.
Index: gcc/calls.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/calls.c,v
retrieving revision 1.172
diff -u -p -r1.172 calls.c
--- gcc/calls.c 2000/12/30 14:52:15 1.172
+++ gcc/calls.c 2001/01/05 04:22:14
@@ -3589,7 +3589,11 @@ emit_library_call_value_1 (retval, orgfu
argvec = (struct arg *) alloca ((nargs + 1) * sizeof (struct arg));
memset ((char *) argvec, 0, (nargs + 1) * sizeof (struct arg));
+#ifdef INIT_CUMULATIVE_LIBCALL_ARGS
+ INIT_CUMULATIVE_LIBCALL_ARGS (args_so_far, outmode, fun);
+#else
INIT_CUMULATIVE_ARGS (args_so_far, NULL_TREE, fun, 0);
+#endif
args_size.constant = 0;
args_size.var = 0;
Index: gcc/tm.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/tm.texi,v
retrieving revision 1.161
diff -u -p -r1.161 tm.texi
--- gcc/tm.texi 2001/01/03 21:13:29 1.161
+++ gcc/tm.texi 2001/01/05 04:23:18
@@ -3045,6 +3045,14 @@ an ordinary C function call is being pro
macro is called, either @var{libname} or @var{fntype} is nonzero, but
never both of them at once.
+@findex INIT_CUMULATIVE_LIBCALL_ARGS @item
+INIT_CUMULATIVE_LIBCALL_ARGS (@var{cum}, @var{mode}, @var{libname})
+Like @code{INIT_CUMULATIVE_ARGS} but only used for outgoing libcalls,
+it gets a @code{MODE} argument instead of @var{fntype}, that would be
+@code{NULL}. @var{indirect} would always be zero, too. If this macro
+is not defined, @code{INIT_CUMULATIVE_ARGS (cum, NULL_RTX, libname,
+0)} is used instead.
+
@findex INIT_CUMULATIVE_INCOMING_ARGS
@item INIT_CUMULATIVE_INCOMING_ARGS (@var{cum}, @var{fntype}, @var{libname})
Like @code{INIT_CUMULATIVE_ARGS} but overrides it for the purposes of
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me