diff mbox

Fix bogus waring on gcov-io.c in profiledbootstrap

Message ID 20121115010829.GD12910@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Nov. 15, 2012, 1:08 a.m. UTC
Hi,
gcov-io.c contains bogus array bounds check that makes us to unroll one time
too many and trigger bogus -Warray-bounds warning.
I made testcase for PR55079 and fixed the bounds check.

Bootstrapped/regtested/comitted x86_64.
Honza
	PR bootstrap/55051
	* gcov-io.c (gcov_read_summary): Fix array bound check.
diff mbox

Patch

Index: gcov-io.c
===================================================================
--- gcov-io.c	(revision 193505)
+++ gcov-io.c	(working copy)
@@ -552,8 +552,8 @@  gcov_read_summary (struct gcov_summary *
           while (!cur_bitvector)
             {
               h_ix = bv_ix * 32;
+              gcc_assert(bv_ix < GCOV_HISTOGRAM_BITVECTOR_SIZE);
               cur_bitvector = histo_bitvector[bv_ix++];
-              gcc_assert(bv_ix <= GCOV_HISTOGRAM_BITVECTOR_SIZE);
             }
           while (!(cur_bitvector & 0x1))
             {