summaryrefslogtreecommitdiff
path: root/gcc/ggc-page.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2017-05-02 22:39:23 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2017-05-02 22:39:23 +0000
commit3608eff93dfe71840d824fc8bbbafd21655893fa (patch)
tree1a18b1a2f6601b38461a204f8868da68896cd415 /gcc/ggc-page.c
parent0e8d6eb79458dbf590d4464496f8a55663813c79 (diff)
ggc-page.c (move_ptes_to_front): Replace unsigned >0 with i-- check.
* ggc-page.c (move_ptes_to_front): Replace unsigned >0 with i-- check. Fix formatting. From-SVN: r247529
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r--gcc/ggc-page.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index dd655608309..5f79e32ded4 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -2507,8 +2507,6 @@ ggc_pch_finish (struct ggc_pch_data *d, FILE *f)
static void
move_ptes_to_front (int count_old_page_tables, int count_new_page_tables)
{
- unsigned i;
-
/* First, we swap the new entries to the front of the varrays. */
page_entry **new_by_depth;
unsigned long **new_save_in_use;
@@ -2536,10 +2534,10 @@ move_ptes_to_front (int count_old_page_tables, int count_new_page_tables)
G.save_in_use = new_save_in_use;
/* Now update all the index_by_depth fields. */
- for (i = G.by_depth_in_use; i > 0; --i)
+ for (unsigned i = G.by_depth_in_use; i--;)
{
- page_entry *p = G.by_depth[i-1];
- p->index_by_depth = i-1;
+ page_entry *p = G.by_depth[i];
+ p->index_by_depth = i;
}
/* And last, we update the depth pointers in G.depth. The first