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 07/18] loop-iv.c: make cond_list a vec


On 04/20/2016 08:22 AM, tbsaunde+gcc@tbsaunde.org wrote:
From: Trevor Saunders <tbsaunde+gcc@tbsaunde.org>

+		  unsigned int len = cond_list.length ();
+		  for (unsigned int i = len - 1; i < len; i--)

This is a really icky way to write a loop, the i < len condition makes it look like a forward one. We have FOR_EACH_VEC_ELT{,_REVERSE}, any reason not to use these?


Bernd


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