This is the mail archive of the
mailing list for the GCC project.
limiting call clobbered registers for library functions
- From: Paul Shortis <pshortis at dataworx dot com dot au>
- To: gcc at gcc dot gnu dot org
- Date: Thu, 29 Jan 2015 20:08:31 +1000
- Subject: limiting call clobbered registers for library functions
- Authentication-results: sourceware.org; auth=none
- Reply-to: pshortis at dataworx dot com dot au
I've ported GCC to a small 16 bit CPU that has single bit shifts.
So I've handled variable / multi-bit shifts using a mix of inline
shifts and calls to assembler support functions.
The calls to the asm library functions clobber only one (by
const) or two (variable) registers but of course calling these
functions causes all of the standard call clobbered registers to
be considered clobbered, thus wasting lots of candidate registers
for use in expressions surrounding these shifts and causing
unnecessary register saves in the surrounding function
I've scrutinized and cloned the actions of other ports that do
the same, however I'm unable to convince the various passes that
only r1 and r2 can be clobbered by these library calls.
Is anyone able to point me in the proper direction for a solution
to this problem ?