This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to "disable" register allocation?
- From: Mike Stump <mrs at apple dot com>
- To: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 7 Apr 2005 13:47:24 -0700
- Subject: Re: How to "disable" register allocation?
On Thursday, April 7, 2005, at 09:12 AM, Øyvind Harboe wrote:
Is there an option(compile/build time?) to tell GCC to use as few
registers as possible?
There's always the manual:
@item -ffixed-@var{reg}
@opindex ffixed
Treat the register named @var{reg} as a fixed register; generated code
should never refer to it (except perhaps as a stack pointer, frame
pointer or in some other fixed role).
@var{reg} must be the name of a register. The register names accepted
are machine-specific and are defined in the @code{REGISTER_NAMES}
macro in the machine description macro file.
This flag does not have a negative form, because it specifies a
three-way choice.
If you fix all but 4 registers, then the compiler will only use the
remaining 4. Extra credit if your code compiles with just 2 registers
left!