This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: new allocator: registers preferences
- To: Denis Chertykov <denisc at overta dot ru>
- Subject: Re: new allocator: registers preferences
- From: Michael Matz <matzmich at cs dot tu-berlin dot de>
- Date: Sun, 25 Feb 2001 23:37:55 +0100 (MET)
- cc: <gcc-patches at gcc dot gnu dot org>, Daniel Berlin <dberlin at redhat dot com>
Hi,
On Sun, 25 Feb 2001, Denis Chertykov wrote:
> Sun Feb 25 22:14:13 2001 Denis Chertykov <denisc@overta.ru>
>
> * ra.c (get_free_reg): Use preferred register order for selection.
> (colorize_one_web): Use call_used_reg_set as preference.
> (init_ra): arg,frame,stack pointers can use few hard regs.
Thanks. Applied with the following small tweak and a comment in
colorize_one_web:
- return pref_reg > 0 ? pref_reg : last_resort_reg;
+ return pref_reg >= 0 ? pref_reg : last_resort_reg;
Without that, on x86 e.g. it first selects 0 as pref_reg, but then returns
-1, which results in spilling, next round it again tries 0, spills again,
next round ... you can imagine ;)
Ciao,
Michael.