From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25994 invoked by alias); 28 Apr 2017 09:31:40 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 25905 invoked by uid 89); 28 Apr 2017 09:31:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Apr 2017 09:31:33 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6312FAC4F for ; Fri, 28 Apr 2017 09:31:33 +0000 (UTC) Resent-From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Resent-To: GCC Patches Resent-Date: Fri, 28 Apr 2017 11:31:32 +0200 Resent-Message-ID: Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 Message-Id: In-Reply-To: References: From: marxin Date: Fri, 28 Apr 2017 09:31:00 -0000 Subject: [PATCH 1/8] gcno file: do not stream block flags (PR gcov-profile/80031). To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz, nathan@acm.org X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg01458.txt.bz2 gcc/ChangeLog: 2017-03-13 Martin Liska PR gcov-profile/80031 * gcov-dump.c (tag_blocks): Just print number of basic blocks. * gcov-io.h (GCOV_TAG_BLOCKS_NUM): Remove unused macro. * gcov.c (read_graph_file): Read just number of blocks. * profile.c (branch_prob): Do not stream 0 flags per a basic block. --- gcc/gcov-dump.c | 22 ++-------------------- gcc/gcov-io.h | 1 - gcc/gcov.c | 7 +------ gcc/profile.c | 3 +-- 4 files changed, 4 insertions(+), 29 deletions(-) diff --git a/gcc/gcov-dump.c b/gcc/gcov-dump.c index 47db1795313..f2522577e9d 100644 --- a/gcc/gcov-dump.c +++ b/gcc/gcov-dump.c @@ -318,27 +318,9 @@ tag_function (const char *filename ATTRIBUTE_UNUSED, static void tag_blocks (const char *filename ATTRIBUTE_UNUSED, unsigned tag ATTRIBUTE_UNUSED, unsigned length ATTRIBUTE_UNUSED, - unsigned depth) + unsigned depth ATTRIBUTE_UNUSED) { - unsigned n_blocks = GCOV_TAG_BLOCKS_NUM (length); - - printf (" %u blocks", n_blocks); - - if (flag_dump_contents) - { - unsigned ix; - - for (ix = 0; ix != n_blocks; ix++) - { - if (!(ix & 7)) - { - printf ("\n"); - print_prefix (filename, depth, gcov_position ()); - printf (VALUE_PADDING_PREFIX VALUE_PREFIX, ix); - } - printf ("%04x ", gcov_read_unsigned ()); - } - } + printf (" %u blocks", gcov_read_unsigned ()); } static void diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h index 1fb58dd918e..1c8ee8f9a2a 100644 --- a/gcc/gcov-io.h +++ b/gcc/gcov-io.h @@ -230,7 +230,6 @@ typedef uint64_t gcov_type_unsigned; #define GCOV_TAG_FUNCTION_LENGTH (3) #define GCOV_TAG_BLOCKS ((gcov_unsigned_t)0x01410000) #define GCOV_TAG_BLOCKS_LENGTH(NUM) (NUM) -#define GCOV_TAG_BLOCKS_NUM(LENGTH) (LENGTH) #define GCOV_TAG_ARCS ((gcov_unsigned_t)0x01430000) #define GCOV_TAG_ARCS_LENGTH(NUM) (1 + (NUM) * 2) #define GCOV_TAG_ARCS_NUM(LENGTH) (((LENGTH) - 1) / 2) diff --git a/gcc/gcov.c b/gcc/gcov.c index bb26a1a9787..63f6a75f1af 100644 --- a/gcc/gcov.c +++ b/gcc/gcov.c @@ -129,7 +129,6 @@ typedef struct block_info /* Block execution count. */ gcov_type count; - unsigned flags : 12; unsigned count_valid : 1; unsigned valid_chain : 1; unsigned invalid_chain : 1; @@ -1374,12 +1373,8 @@ read_graph_file (void) bbg_file_name, fn->name); else { - unsigned ix, num_blocks = GCOV_TAG_BLOCKS_NUM (length); - fn->num_blocks = num_blocks; - + fn->num_blocks = gcov_read_unsigned (); fn->blocks = XCNEWVEC (block_t, fn->num_blocks); - for (ix = 0; ix != num_blocks; ix++) - fn->blocks[ix].flags = gcov_read_unsigned (); } } else if (fn && tag == GCOV_TAG_ARCS) diff --git a/gcc/profile.c b/gcc/profile.c index c6f462d2f7a..c7eed0e3dfd 100644 --- a/gcc/profile.c +++ b/gcc/profile.c @@ -1195,8 +1195,7 @@ branch_prob (void) /* Basic block flags */ offset = gcov_write_tag (GCOV_TAG_BLOCKS); - for (i = 0; i != (unsigned) (n_basic_blocks_for_fn (cfun)); i++) - gcov_write_unsigned (0); + gcov_write_unsigned (n_basic_blocks_for_fn (cfun)); gcov_write_length (offset); /* Arcs */ -- 2.12.2