From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87924 invoked by alias); 9 Jun 2015 13:11:41 -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 87911 invoked by uid 89); 9 Jun 2015 13:11:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 09 Jun 2015 13:11:39 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 16EAAAC8C; Tue, 9 Jun 2015 13:11:36 +0000 (UTC) Message-ID: <5576E606.1060407@suse.cz> Date: Tue, 09 Jun 2015 13:21:00 -0000 From: =?UTF-8?B?TWFydGluIExpxaFrYQ==?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: GCC Patches CC: ismail@donmez.ws Subject: [PATCH] Fix PR bootstrap/66471 Content-Type: multipart/mixed; boundary="------------010604050305020505010309" X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00666.txt.bz2 This is a multi-part message in MIME format. --------------010604050305020505010309 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 226 Hello. Following patch renames an enum values so that they do not clash with a MinGW reserved keyword. Patch can bootstrap on MinGW and there's no regression seen on x86_64-linux-unknown-gnu. Ready for trunk? Thanks, Martin --------------010604050305020505010309 Content-Type: text/x-patch; name="0001-Fix-BITMAP-identifier-clash.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-Fix-BITMAP-identifier-clash.patch" Content-length: 7510 >From 740811e0af76af3e1e2f39f149c35bd49ef5fed3 Mon Sep 17 00:00:00 2001 From: mliska Date: Tue, 9 Jun 2015 13:27:53 +0200 Subject: [PATCH] Fix BITMAP identifier clash. gcc/ChangeLog: 2015-06-09 Martin Liska PR bootstrap/66471 * mem-stats-traits.h (enum mem_alloc_origin): Add _ORIGIN suffix for all enum values in mem_alloc_origin. * alloc-pool.c (dump_alloc_pool_statistics): Use newly changed enum name. * alloc-pool.h (pool_allocator::pool_allocator): Likewise. * bitmap.c (bitmap_register): Likewise. (dump_bitmap_statistics): Likewise. * ggc-common.c (dump_ggc_loc_statistics): Likewise. (ggc_record_overhead): Likewise. * hash-map.h: Likewise. * hash-set.h: Likewise. * hash-table.c (void dump_hash_table_loc_statistics): Likewise. * hash-table.h: Likewise. * vec.c (vec_prefix::register_overhead): Likewise. (vec_prefix::release_overhead): Likewise. (dump_vec_loc_statistics): Likewise. --- gcc/alloc-pool.c | 2 +- gcc/alloc-pool.h | 2 +- gcc/bitmap.c | 5 +++-- gcc/ggc-common.c | 4 ++-- gcc/hash-map.h | 2 +- gcc/hash-set.h | 2 +- gcc/hash-table.c | 2 +- gcc/hash-table.h | 4 ++-- gcc/mem-stats-traits.h | 14 +++++++------- gcc/vec.c | 8 +++++--- 10 files changed, 24 insertions(+), 21 deletions(-) diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c index bdf184a..7e25915 100644 --- a/gcc/alloc-pool.c +++ b/gcc/alloc-pool.c @@ -33,5 +33,5 @@ dump_alloc_pool_statistics (void) if (! GATHER_STATISTICS) return; - pool_allocator_usage.dump (ALLOC_POOL); + pool_allocator_usage.dump (ALLOC_POOL_ORIGIN); } diff --git a/gcc/alloc-pool.h b/gcc/alloc-pool.h index af3adde..1785df5 100644 --- a/gcc/alloc-pool.h +++ b/gcc/alloc-pool.h @@ -232,7 +232,7 @@ pool_allocator::pool_allocator (const char *name, size_t num, m_elts_free (0), m_blocks_allocated (0), m_block_list (NULL), m_block_size (0), m_ignore_type_size (ignore_type_size), m_extra_size (extra_size), m_initialized (false), - m_location (ALLOC_POOL, false PASS_MEM_STAT) {} + m_location (ALLOC_POOL_ORIGIN, false PASS_MEM_STAT) {} /* Initialize a pool allocator. */ diff --git a/gcc/bitmap.c b/gcc/bitmap.c index d600ace..733c767 100644 --- a/gcc/bitmap.c +++ b/gcc/bitmap.c @@ -30,7 +30,8 @@ mem_alloc_description bitmap_mem_desc; void bitmap_register (bitmap b MEM_STAT_DECL) { - bitmap_mem_desc.register_descriptor (b, BITMAP, false FINAL_PASS_MEM_STAT); + bitmap_mem_desc.register_descriptor (b, BITMAP_ORIGIN, false + FINAL_PASS_MEM_STAT); } /* Account the overhead. */ @@ -2076,7 +2077,7 @@ dump_bitmap_statistics (void) if (! GATHER_STATISTICS) return; - bitmap_mem_desc.dump (BITMAP); + bitmap_mem_desc.dump (BITMAP_ORIGIN); } DEBUG_FUNCTION void diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c index 6021c2a..60d427f 100644 --- a/gcc/ggc-common.c +++ b/gcc/ggc-common.c @@ -977,7 +977,7 @@ dump_ggc_loc_statistics (bool final) ggc_force_collect = true; ggc_collect (); - ggc_mem_desc.dump (GGC, final ? ggc_usage::compare_final : NULL); + ggc_mem_desc.dump (GGC_ORIGIN, final ? ggc_usage::compare_final : NULL); ggc_force_collect = false; } @@ -986,7 +986,7 @@ dump_ggc_loc_statistics (bool final) void ggc_record_overhead (size_t allocated, size_t overhead, void *ptr MEM_STAT_DECL) { - ggc_usage *usage = ggc_mem_desc.register_descriptor (ptr, GGC, false + ggc_usage *usage = ggc_mem_desc.register_descriptor (ptr, GGC_ORIGIN, false FINAL_PASS_MEM_STAT); ggc_mem_desc.register_object_overhead (usage, allocated + overhead, ptr); diff --git a/gcc/hash-map.h b/gcc/hash-map.h index f28f74f..2f1bca4 100644 --- a/gcc/hash-map.h +++ b/gcc/hash-map.h @@ -107,7 +107,7 @@ class GTY((user)) hash_map public: explicit hash_map (size_t n = 13, bool ggc = false, bool gather_mem_stats = true CXX_MEM_STAT_INFO) - : m_table (n, ggc, gather_mem_stats, HASH_MAP PASS_MEM_STAT) {} + : m_table (n, ggc, gather_mem_stats, HASH_MAP_ORIGIN PASS_MEM_STAT) {} /* Create a hash_map in ggc memory. */ static hash_map *create_ggc (size_t size, bool gather_mem_stats = true diff --git a/gcc/hash-set.h b/gcc/hash-set.h index af91e31..3ec0b15 100644 --- a/gcc/hash-set.h +++ b/gcc/hash-set.h @@ -179,7 +179,7 @@ class hash_set public: explicit hash_set (size_t n = 13, bool ggc = false CXX_MEM_STAT_INFO) - : m_table (n, ggc, true, HASH_SET PASS_MEM_STAT) {} + : m_table (n, ggc, true, HASH_SET_ORIGIN PASS_MEM_STAT) {} /* Create a hash_set in gc memory with space for at least n elements. */ diff --git a/gcc/hash-table.c b/gcc/hash-table.c index 012b241..a42b884 100644 --- a/gcc/hash-table.c +++ b/gcc/hash-table.c @@ -103,7 +103,7 @@ mem_alloc_description hash_table_usage; /* Support function for statistics. */ void dump_hash_table_loc_statistics (void) { - for (unsigned i = HASH_TABLE; i <= HASH_SET; i++) + for (unsigned i = HASH_TABLE_ORIGIN; i <= HASH_SET_ORIGIN; i++) { mem_alloc_origin origin = (mem_alloc_origin) i; hash_table_usage.dump (origin); diff --git a/gcc/hash-table.h b/gcc/hash-table.h index 512f162..1b9322d 100644 --- a/gcc/hash-table.h +++ b/gcc/hash-table.h @@ -590,7 +590,7 @@ class hash_table public: explicit hash_table (size_t, bool ggc = false, bool gather_mem_stats = true, - mem_alloc_origin origin = HASH_TABLE + mem_alloc_origin origin = HASH_TABLE_ORIGIN CXX_MEM_STAT_INFO); ~hash_table (); @@ -600,7 +600,7 @@ public: create_ggc (size_t n CXX_MEM_STAT_INFO) { hash_table *table = ggc_alloc (); - new (table) hash_table (n, true, true, HASH_TABLE PASS_MEM_STAT); + new (table) hash_table (n, true, true, HASH_TABLE_ORIGIN PASS_MEM_STAT); return table; } diff --git a/gcc/mem-stats-traits.h b/gcc/mem-stats-traits.h index f7843f2..5d27047 100644 --- a/gcc/mem-stats-traits.h +++ b/gcc/mem-stats-traits.h @@ -4,13 +4,13 @@ /* Memory allocation origin. */ enum mem_alloc_origin { - HASH_TABLE, - HASH_MAP, - HASH_SET, - VEC, - BITMAP, - GGC, - ALLOC_POOL, + HASH_TABLE_ORIGIN, + HASH_MAP_ORIGIN, + HASH_SET_ORIGIN, + VEC_ORIGIN, + BITMAP_ORIGIN, + GGC_ORIGIN, + ALLOC_POOL_ORIGIN, MEM_ALLOC_ORIGIN_LENGTH }; diff --git a/gcc/vec.c b/gcc/vec.c index e0307dd..b6c3178 100644 --- a/gcc/vec.c +++ b/gcc/vec.c @@ -136,7 +136,8 @@ void vec_prefix::register_overhead (void *ptr, size_t size, size_t elements MEM_STAT_DECL) { - vec_mem_desc.register_descriptor (ptr, VEC, false FINAL_PASS_MEM_STAT); + vec_mem_desc.register_descriptor (ptr, VEC_ORIGIN, false + FINAL_PASS_MEM_STAT); vec_usage *usage = vec_mem_desc.register_instance_overhead (size, ptr); usage->m_items += elements; if (usage->m_items_peak < usage->m_items) @@ -150,7 +151,8 @@ vec_prefix::release_overhead (void *ptr, size_t size, bool in_dtor MEM_STAT_DECL) { if (!vec_mem_desc.contains_descriptor_for_instance (ptr)) - vec_mem_desc.register_descriptor (ptr, VEC, false FINAL_PASS_MEM_STAT); + vec_mem_desc.register_descriptor (ptr, VEC_ORIGIN, + false FINAL_PASS_MEM_STAT); vec_mem_desc.release_instance_overhead (ptr, size, in_dtor); } @@ -185,5 +187,5 @@ vec_prefix::calculate_allocation_1 (unsigned alloc, unsigned desired) void dump_vec_loc_statistics (void) { - vec_mem_desc.dump (VEC); + vec_mem_desc.dump (VEC_ORIGIN); } -- 2.1.4 --------------010604050305020505010309--