This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: new-ra code sizes on Hitachi H8
- From: <tm_gccmail at mail dot kloo dot net>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: matz at suse dot de, gcc at gcc dot gnu dot org, law at redhat dot com
- Date: Thu, 13 Feb 2003 11:17:37 -0800 (PST)
- Subject: Re: new-ra code sizes on Hitachi H8
On Thu, 13 Feb 2003, Kazu Hirata wrote:
> Hi Toshi,
>
> > The Hitachi H8 is a fairly difficult register-allocation situation -
> > only 8 general-purpose registers. So new-ra seems to be doing fairly
> > well. Only 4 testcases increased in size; the other 12 decreased in
> > size.
>
> This is impressive. Maybe I should help Michael Matz by running
> testsuite and other things with -fnew-ra. Thanks for reporting this.
> Also I am happy to see code size decreasing over the past few
> years. :-)
>
> Kazu Hirata
Me too. :)
The H8 has always seemed to have code size issues. The cause seems to be
the following two items in tandem:
1) Only 8 general purpose registers
2) The instructions for spilling/restoring registers to/from the stack are
6 bytes - mov.l ers,@(d:16,erd) and mov.l @(d:16,ers),erd
So the register allocation is totally crucial for the H8. If your register
allocator isn't doing well, then you generate more spill/restores to the
stack, and each pair of those takes 12 opcode bytes...
The H8 target is like the "canary in a coal mine" - it's very sensitive to
register allocation issues.
Toshi