From patchwork Mon Oct 26 21:49:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1388144 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CKpPz4wh7z9sSf for ; Tue, 27 Oct 2020 08:49:11 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C648B3948827; Mon, 26 Oct 2020 21:49:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 6F192394743F for ; Mon, 26 Oct 2020 21:49:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6F192394743F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=hubicka@kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 927152829D2; Mon, 26 Oct 2020 22:49:01 +0100 (CET) Date: Mon, 26 Oct 2020 22:49:01 +0100 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, rguenther@suse.de Subject: Fix builtin decls generated in tree.c Message-ID: <20201026214901.GF44896@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-16.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, tree.c still produces "fn spec" attribute for memcpy, memmove and memset. This is not desirable since "1" is less informative than fnspec builtin_fnspec returns. Also the buitin would fire checker, since it misses the second caracter, so probably the whole logic is unused. Bootstrapped/regtested x86_64-linux, OK? gcc/ChangeLog: 2020-10-26 Jan Hubicka * tree.c (set_call_expr_flags): Fix string for ECF_RET1. (build_common_builtin_nodes): Do not set ECF_RET1 for memcpy, memmove, and memset. They are handled by builtin_fnspec. diff --git a/gcc/tree.c b/gcc/tree.c index 6759ac8179a..218dc00f220 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -10514,7 +10514,7 @@ set_call_expr_flags (tree decl, int flags) if (flags & ECF_RET1) DECL_ATTRIBUTES (decl) = tree_cons (get_identifier ("fn spec"), - build_tree_list (NULL_TREE, build_string (1, "1")), + build_tree_list (NULL_TREE, build_string (2, "1 ")), DECL_ATTRIBUTES (decl)); if ((flags & ECF_TM_PURE) && flag_tm) apply_tm_attr (decl, get_identifier ("transaction_pure")); @@ -10576,10 +10576,10 @@ build_common_builtin_nodes (void) if (!builtin_decl_explicit_p (BUILT_IN_MEMCPY)) local_define_builtin ("__builtin_memcpy", ftype, BUILT_IN_MEMCPY, - "memcpy", ECF_NOTHROW | ECF_LEAF | ECF_RET1); + "memcpy", ECF_NOTHROW | ECF_LEAF); if (!builtin_decl_explicit_p (BUILT_IN_MEMMOVE)) local_define_builtin ("__builtin_memmove", ftype, BUILT_IN_MEMMOVE, - "memmove", ECF_NOTHROW | ECF_LEAF | ECF_RET1); + "memmove", ECF_NOTHROW | ECF_LEAF); } if (!builtin_decl_explicit_p (BUILT_IN_MEMCMP)) @@ -10597,7 +10597,7 @@ build_common_builtin_nodes (void) ptr_type_node, integer_type_node, size_type_node, NULL_TREE); local_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET, - "memset", ECF_NOTHROW | ECF_LEAF | ECF_RET1); + "memset", ECF_NOTHROW | ECF_LEAF); } /* If we're checking the stack, `alloca' can throw. */