From patchwork Fri Apr 21 11:35:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1771843 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=cUEad/p1; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Q2ssK6gjSz23rW for ; Fri, 21 Apr 2023 21:35:33 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4723385772A for ; Fri, 21 Apr 2023 11:35:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4723385772A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682076930; bh=rkhWb8ysYCTHeqDE768l7uC4VE8daUJRtCVlCW2oqLk=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=cUEad/p1pPt4DjVKu/OQaHAIe6+9Diy1dNBt8nB7Z5PxygO/4vUP2epRWubdr72SZ ypv8asR8K9bsgbhevEGzPObXg8nRpX7AKKD0SNclUYi5D5XKvclp/2IYVYozuXdth5 Fw1C7ZxrOTcQzevkNe3q+p3QavAc0VozQsIsuK4M= 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 0AF683858C83 for ; Fri, 21 Apr 2023 11:35:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0AF683858C83 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 7D0C428A920; Fri, 21 Apr 2023 13:35:09 +0200 (CEST) Date: Fri, 21 Apr 2023 13:35:09 +0200 To: gcc-patches@gcc.gnu.org Subject: Remove dead handling of label_decl in tree merging Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Jan Hubicka via Gcc-patches From: Jan Hubicka Reply-To: Jan Hubicka Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, while working on incremental WHOPR with Michal Jires, we noticed that there is code hashing LABEL_DECL_UID in lto-streamer-out which would break the hash table, since label decls are not streamed and gets re-initialized later. The whole conditional is dead since LABEL_DECLs are not merged across TUs. ltobootstrapped/regtested x86_64-linux, plan to commit it shortly. gcc/ChangeLog: * lto-streamer-out.cc (hash_tree): Remove dead handling of LABEL_DECL. gcc/lto/ChangeLog: * lto-common.cc (compare_tree_sccs_1): Remove dead handling of LABEL_DECL. diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc index 0bca530313c..27f9edd3fcd 100644 --- a/gcc/lto-streamer-out.cc +++ b/gcc/lto-streamer-out.cc @@ -1268,12 +1268,8 @@ hash_tree (struct streamer_tree_cache_d *cache, hash_map *map, hstate.add_flag (DECL_NOT_GIMPLE_REG_P (t)); hstate.commit_flag (); hstate.add_int (DECL_ALIGN (t)); - if (code == LABEL_DECL) - { - hstate.add_int (EH_LANDING_PAD_NR (t)); - hstate.add_int (LABEL_DECL_UID (t)); - } - else if (code == FIELD_DECL) + gcc_checking_assert (code != LABEL_DECL); + if (code == FIELD_DECL) { hstate.add_flag (DECL_PACKED (t)); hstate.add_flag (DECL_NONADDRESSABLE_P (t)); diff --git a/gcc/lto/lto-common.cc b/gcc/lto/lto-common.cc index 882dd8971a4..597fc5dbabf 100644 --- a/gcc/lto/lto-common.cc +++ b/gcc/lto/lto-common.cc @@ -1180,12 +1180,8 @@ compare_tree_sccs_1 (tree t1, tree t2, tree **map) compare_values (DECL_EXTERNAL); compare_values (DECL_NOT_GIMPLE_REG_P); compare_values (DECL_ALIGN); - if (code == LABEL_DECL) - { - compare_values (EH_LANDING_PAD_NR); - compare_values (LABEL_DECL_UID); - } - else if (code == FIELD_DECL) + gcc_checking_assert (code != LABEL_DECL); + if (code == FIELD_DECL) { compare_values (DECL_PACKED); compare_values (DECL_NONADDRESSABLE_P);