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]
Other format: [Raw text]

Re: [patch] global.c: Use VEC instead of VARRAY (Take 2)


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


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