This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] global.c: Use VEC instead of VARRAY (Take 2)
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 27 Apr 2005 09:21:01 +0100
- Subject: Re: [patch] global.c: Use VEC instead of VARRAY (Take 2)
- Organization: CodeSourcery LLC
- References: <20050426.235948.108812435.kazu@cs.umass.edu>
Kazu,
Nathan, could you take a look at this patch? I used VEC_iterate as
suggested. I am pretty sure you'll be happy with this one, but just
in case.
It looks ok to me, but yet another thought occurred when reading. ...
If we know the maximum length the vector can get, then this ...
+ VEC_safe_push (int, heap, earlyclobber_regclass,
+ (int) class);
could be a quick push. and this ...
+ earlyclobber_regclass = VEC_alloc (int, heap, 20);
could allocate the correct length.
If I read the code right, we do know the maximum length, it is
N_REG_CLASSES :)
sorry I didn't spot this earlier.
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk