public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH GCC][OBVIOUS]Handle boundary case for last iv candidate
@ 2017-08-08 14:43 Bin Cheng
  0 siblings, 0 replies; only message in thread
From: Bin Cheng @ 2017-08-08 14:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: nd

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

Hi,
When investigate issues, I ran into this obvious issue that the last candidate is not related to compare type iv_use.
This patch fixes it.  Will apply later.

Thanks,
bin
2017-08-08  Bin Cheng  <bin.cheng@arm.com>

	* tree-ssa-loop-ivopts.c (relate_compare_use_with_all_cands): Handle
	boundary case for the last candidate.

[-- Attachment #2: obvious-boundary-case.txt --]
[-- Type: text/plain, Size: 695 bytes --]

diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c
index 1cbff04..b65cd96 100644
--- a/gcc/tree-ssa-loop-ivopts.c
+++ b/gcc/tree-ssa-loop-ivopts.c
@@ -5284,13 +5284,13 @@ set_autoinc_for_original_candidates (struct ivopts_data *data)
 static void
 relate_compare_use_with_all_cands (struct ivopts_data *data)
 {
-  unsigned i, max_id = data->vcands.length () - 1;
+  unsigned i, count = data->vcands.length ();
   for (i = 0; i < data->vgroups.length (); i++)
     {
       struct iv_group *group = data->vgroups[i];
 
       if (group->type == USE_COMPARE)
-	bitmap_set_range (group->related_cands, 0, max_id);
+	bitmap_set_range (group->related_cands, 0, count);
     }
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-08-08 14:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 14:43 [PATCH GCC][OBVIOUS]Handle boundary case for last iv candidate Bin Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).