This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 07/18] loop-iv.c: make cond_list a vec
- From: Bernd Schmidt <bschmidt at redhat dot com>
- To: tbsaunde+gcc at tbsaunde dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 25 Apr 2016 14:28:51 +0200
- Subject: Re: [PATCH 07/18] loop-iv.c: make cond_list a vec
- Authentication-results: sourceware.org; auth=none
- References: <1461133342-10794-1-git-send-email-tbsaunde+gcc at tbsaunde dot org> <1461133342-10794-8-git-send-email-tbsaunde+gcc at tbsaunde dot org>
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