This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Implementing Library calls
- From: John Lu <jlu at lsil dot com>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 6 Nov 2003 10:40:50 -0600 (CST)
- Subject: Implementing Library calls
- Reply-to: John Lu <jlu at lsil dot com>
Hi,
I'm working on a port where a long->float conversion is done
by a library call. The calling convention requires that the long
be passed in memory. I have a problem when making a call like:
long foo;
printf("%E",((float) foo));
All the arguments to printf are passed in memory. The pointer to the
string is placed in memory, but then it is clobbered by the call to
the long->float conversion, since the long argument is passed in memory.
When I invoke, emit_library_call_value(), for the long->float conversion,
I've used LCT_CONST and LCT_NORMAL for the libcall_type argument, but
neither fixes my problem.
Thanks,
John Lu