This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: new allocator: registers preferences


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]