From patchwork Thu Nov 15 01:08:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Fix bogus waring on gcov-io.c in profiledbootstrap Date: Wed, 14 Nov 2012 15:08:29 -0000 From: Jan Hubicka X-Patchwork-Id: 199089 Message-Id: <20121115010829.GD12910@kam.mff.cuni.cz> To: gcc-patches@gcc.gnu.org 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. 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)) {