From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 2866B3948831 for ; Tue, 10 May 2022 08:56:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2866B3948831 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E77ED2189F; Tue, 10 May 2022 08:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1652173010; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VUTghVHDutPn6kMsY17BoFA0yGc0Z+NfUYgL+465J8I=; b=U5uQH2OrEcMkFtBlanEHN0BAiJeovdYgrOkfUOMoi1FZLcU/OGM3uPXj8iI1hrdOu9agUE MlLZCrvYQe3fBp+dYovQvKa70ucNyZoTkndOLgEtJMu/N1MlyPOCRYumOeIJhS+sMRzhNS UaO2Un3DIpD+C409wdfYMoNO3Q9aP+Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1652173010; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=VUTghVHDutPn6kMsY17BoFA0yGc0Z+NfUYgL+465J8I=; b=rarw2PMG0E+LRc7mXJatzGGRjoDnpkap8berJ6UytfvCpjRG7Ir5lQGzFBJENNYV1PEXAh liiV2rkexNDxrvBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id B472A13AA5; Tue, 10 May 2022 08:56:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id i1xFKdIoemJ9IQAAMHmgww (envelope-from ); Tue, 10 May 2022 08:56:50 +0000 Message-ID: <876b42c5-7459-57f5-63f5-ece34c295cd1@suse.cz> Date: Tue, 10 May 2022 10:56:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH] Replace PTR with 'void *' in compiler. To: gcc-patches@gcc.gnu.org Content-Language: en-US Cc: Alan Modra Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 May 2022 08:56:54 -0000 Similarly in GCC itself. I've built all FEs with the patch. Patch can bootstrap on x86_64-linux-gnu and survives regression tests. Ready to be installed? Thanks, Martin gcc/ada/ChangeLog: * gcc-interface/decl.cc (compare_field_bitpos): Use void * instead PTR. * gcc-interface/utils2.cc (compare_elmt_bitpos): Likewise. gcc/ChangeLog: * basic-block.h (struct basic_block_d): Use void * instead PTR. * cfgloop.h: Likewise. * cgraph.h: Likewise. * gengtype-state.cc (state_ident_by_name): Likewise. (record_type): Likewise. (read_state_already_seen_type): Likewise. * gengtype.cc (dump_type): Likewise. (input_file_by_name): Likewise. (main): Likewise. * ggc-common.cc (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ipa-utils.h (struct ipa_dfs_info): Likewise. * plugin.cc (htab_hash_plugin): Likewise. --- gcc/ada/gcc-interface/decl.cc | 4 ++-- gcc/ada/gcc-interface/utils2.cc | 2 +- gcc/basic-block.h | 4 ++-- gcc/cfgloop.h | 2 +- gcc/cgraph.h | 4 ++-- gcc/gengtype-state.cc | 6 +++--- gcc/gengtype.cc | 6 +++--- gcc/ggc-common.cc | 4 ++-- gcc/ipa-utils.h | 2 +- gcc/plugin.cc | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc index 1c7a716840e..d52c4fb3623 100644 --- a/gcc/ada/gcc-interface/decl.cc +++ b/gcc/ada/gcc-interface/decl.cc @@ -224,7 +224,7 @@ static bool constructor_address_p (tree); static bool allocatable_size_p (tree, bool); static bool initial_value_needs_conversion (tree, tree); static tree update_n_elem (tree, tree, tree); -static int compare_field_bitpos (const PTR, const PTR); +static int compare_field_bitpos (const void *, const void *); static bool components_to_record (Node_Id, Entity_Id, tree, tree, int, bool, bool, bool, bool, bool, bool, bool, tree, tree *); @@ -7712,7 +7712,7 @@ field_has_variable_size (tree field) /* qsort comparer for the bit positions of two record components. */ static int -compare_field_bitpos (const PTR rt1, const PTR rt2) +compare_field_bitpos (const void *rt1, const void *rt2) { const_tree const field1 = * (const_tree const *) rt1; const_tree const field2 = * (const_tree const *) rt2; diff --git a/gcc/ada/gcc-interface/utils2.cc b/gcc/ada/gcc-interface/utils2.cc index e5cd85662b9..76622da8081 100644 --- a/gcc/ada/gcc-interface/utils2.cc +++ b/gcc/ada/gcc-interface/utils2.cc @@ -1936,7 +1936,7 @@ build_call_raise_range (int msg, Node_Id gnat_node, char kind, for record components. */ static int -compare_elmt_bitpos (const PTR rt1, const PTR rt2) +compare_elmt_bitpos (const void *rt1, const void *rt2) { const constructor_elt * const elmt1 = (const constructor_elt *) rt1; const constructor_elt * const elmt2 = (const constructor_elt *) rt2; diff --git a/gcc/basic-block.h b/gcc/basic-block.h index 21a9b24dbf9..c9d1fc91bbb 100644 --- a/gcc/basic-block.h +++ b/gcc/basic-block.h @@ -36,7 +36,7 @@ public: } insns; /* Auxiliary info specific to a pass. */ - PTR aux; + void *aux; /* Location of any goto implicit in the edge. */ location_t goto_locus; @@ -120,7 +120,7 @@ struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_d vec *succs; /* Auxiliary info specific to a pass. */ - PTR GTY ((skip (""))) aux; + void *GTY ((skip (""))) aux; /* Innermost loop containing the block. */ class loop *loop_father; diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h index d2714e20cb0..528b1219bc3 100644 --- a/gcc/cfgloop.h +++ b/gcc/cfgloop.h @@ -148,7 +148,7 @@ public: class loop *next; /* Auxiliary info specific to a pass. */ - PTR GTY ((skip (""))) aux; + void *GTY ((skip (""))) aux; /* The number of times the latch of the loop is executed. This can be an INTEGER_CST, or a symbolic expression representing the number of diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 8c512b648ee..4be67e3cea9 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -628,7 +628,7 @@ public: /* File stream where this node is being written to. */ struct lto_file_decl_data * lto_file_data; - PTR GTY ((skip)) aux; + void *GTY ((skip)) aux; /* Comdat group the symbol is in. Can be private if GGC allowed that. */ tree x_comdat_group; @@ -1895,7 +1895,7 @@ public: /* Additional information about an indirect call. Not cleared when an edge becomes direct. */ cgraph_indirect_call_info *indirect_info; - PTR GTY ((skip (""))) aux; + void *GTY ((skip (""))) aux; /* When equal to CIF_OK, inline this call. Otherwise, points to the explanation why function was not inlined. */ enum cgraph_inline_failed_t inline_failed; diff --git a/gcc/gengtype-state.cc b/gcc/gengtype-state.cc index dfd9ea52785..2c7f642cd3d 100644 --- a/gcc/gengtype-state.cc +++ b/gcc/gengtype-state.cc @@ -313,7 +313,7 @@ fatal_reading_state (struct state_token_st* tok, const char*msg) static struct state_ident_st * state_ident_by_name (const char *name, enum insert_option optins) { - PTR *slot = NULL; + void **slot = NULL; int namlen = 0; struct state_ident_st *stid = NULL; @@ -1435,7 +1435,7 @@ static void read_state_common_type_content (type_p current); static void record_type (type_p type) { - PTR *slot; + void **slot; slot = htab_find_slot (state_seen_types, type, INSERT); gcc_assert (slot); @@ -1451,7 +1451,7 @@ read_state_already_seen_type (type_p *type) if (state_token_kind (t0) == STOK_INTEGER) { - PTR *slot = NULL; + void **slot = NULL; struct type loctype = { TYPE_SCALAR, 0, 0, 0, GC_UNUSED, {0} }; loctype.state_number = t0->stok_un.stok_num; diff --git a/gcc/gengtype.cc b/gcc/gengtype.cc index 793ebd70906..e11da9e46d0 100644 --- a/gcc/gengtype.cc +++ b/gcc/gengtype.cc @@ -4869,7 +4869,7 @@ static htab_t seen_types; static void dump_type (int indent, type_p t) { - PTR *slot; + void **slot; printf ("%*cType at %p: ", indent, ' ', (void *) t); if (t->kind == TYPE_UNDEFINED) @@ -5118,7 +5118,7 @@ static htab_t input_file_htab; input_file* input_file_by_name (const char* name) { - PTR* slot; + void ** slot; input_file* f = NULL; int namlen = 0; if (!name) @@ -5227,7 +5227,7 @@ main (int argc, char **argv) POS_HERE (do_scalar_typedef ("machine_mode", &pos)); POS_HERE (do_scalar_typedef ("fixed_size_mode", &pos)); POS_HERE (do_scalar_typedef ("CONSTEXPR", &pos)); - POS_HERE (do_typedef ("PTR", + POS_HERE (do_typedef ("void *", create_pointer (resolve_typedef ("void", &pos)), &pos)); #undef POS_HERE diff --git a/gcc/ggc-common.cc b/gcc/ggc-common.cc index 9d737d079aa..8b3389e8760 100644 --- a/gcc/ggc-common.cc +++ b/gcc/ggc-common.cc @@ -175,8 +175,8 @@ ggc_cleared_alloc_htab_ignore_args (size_t c ATTRIBUTE_UNUSED, void * ggc_cleared_alloc_ptr_array_two_args (size_t c, size_t n) { - gcc_assert (sizeof (PTR *) == n); - return ggc_cleared_vec_alloc (c); + gcc_assert (sizeof (void **) == n); + return ggc_cleared_vec_alloc (c); } /* These are for splay_tree_new_ggc. */ diff --git a/gcc/ipa-utils.h b/gcc/ipa-utils.h index dc6ba0d52cb..3ca058c0b56 100644 --- a/gcc/ipa-utils.h +++ b/gcc/ipa-utils.h @@ -30,7 +30,7 @@ struct ipa_dfs_info { bool new_node; bool on_stack; struct cgraph_node* next_cycle; - PTR aux; + void *aux; }; diff --git a/gcc/plugin.cc b/gcc/plugin.cc index cbe4b7eff60..17b33e463a9 100644 --- a/gcc/plugin.cc +++ b/gcc/plugin.cc @@ -128,7 +128,7 @@ static const char *str_license = "plugin_is_GPL_compatible"; structure to be inserted into the hash table. */ static hashval_t -htab_hash_plugin (const PTR p) +htab_hash_plugin (const void *p) { const struct plugin_name_args *plugin = (const struct plugin_name_args *) p; return htab_hash_string (plugin->base_name); -- 2.36.0