From patchwork Mon Jul 22 11:53:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 94313 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0631B385DDD6 for ; Mon, 22 Jul 2024 11:53:45 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id 3328A3858D26 for ; Mon, 22 Jul 2024 11:53:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3328A3858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3328A3858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721649200; cv=none; b=MTqbLpGAQxozJ1GRHUBaZyEc+hAcTZjGonfU+IaN3OgSasoJZxoGzJjn18n+c527qiNfLZ4dglSp3ndAzOCmeNiL5ZQQ5npyooEKBKi+5eOjcASV+waQBrgkZDYZ6/EN6rSELIJLo+IjjVU/4DlZhHBhVpJ9LSdnYQPZ7+SBE7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721649200; c=relaxed/simple; bh=aoyREbCI24V51/L9gOMAJUfp45d556+7RELdiP/yiSI=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=tkW8TRvWGbBrQuyuSEeSi8bjMtzDtCsJFc20e9uD0geC+18ytA1Q4lYztzzpTz59EdV5czPYjiU4fZ6/zEbdHDE56YefvXbYQBaNAzCK2AfGfH+TTdwdQKk+d3W8DFPd/vOXQdMeuNBS3EM7FdkXBpSDPTXzLh5TLhvFhKDfQ20= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from murzim.nue2.suse.org (unknown [10.168.4.243]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 1F63B1FB6A for ; Mon, 22 Jul 2024 11:53:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721649196; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=NmnIBnSmJIkDlCd+gwgxlxMvnBa9URPwDzyBQR/c51Y=; b=cySIjfqgAaCW+xYecSn19XjYI6mLDpr5la2phuCCOsA3GUarQy6PzQ3MrTftvIKO+PaFu6 3W40Xua7CPEQc+Po/UO8JZCuuPHjT1Ybyf5eHzp0VZAmIfvmfSBqqgcF2+Tea9c20pBuEX DRb9lfAtRHqB2b6Ji7i44nIk8ym4TUU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721649196; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=NmnIBnSmJIkDlCd+gwgxlxMvnBa9URPwDzyBQR/c51Y=; b=sF8HdZBJWvH8E3A3lya05CWa7l4WDpfeJl94KvLjpmT3iSGKicyo6rdUwNlrpRJntX8l+p efO3to4rWdwdBIDg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1721649195; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=NmnIBnSmJIkDlCd+gwgxlxMvnBa9URPwDzyBQR/c51Y=; b=Pd3HpLp4Z9KoQoYwqsgBz03q0nDAcbTFHLu0sMy+fsHr2JHqjjPrdOxo/+BJA7ylrY2324 76YKOu/vttXegxv20lI56w0pSeqFnoUU6YxLDDj6PgWJjxYDFvB07oiqhigCituVd0By0z CoaAIc6r5hwTKn2Y1zGpRItfHzGA/RA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1721649195; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=NmnIBnSmJIkDlCd+gwgxlxMvnBa9URPwDzyBQR/c51Y=; b=ZKiqDi+HrhrYah0S3itEooP2jTQVF/zYBZvZcwYFLVLb8i7Hw9q3D+kYD4h9+UX5f3qFjK 58vLE4ItdwmpyLBg== Date: Mon, 22 Jul 2024 13:53:15 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix hash of WIDEN_*_EXPR MIME-Version: 1.0 X-Spam-Score: 1.40 X-Spamd-Result: default: False [1.40 / 50.00]; MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_ZERO(0.00)[0]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MISSING_XM_UA(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; MIME_TRACE(0.00)[0:+] X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Message-Id: <20240722115345.0631B385DDD6@sourceware.org> We're hashing operand 2 to the temporary hash. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * fold-const.cc (operand_compare::hash_operand): Fix hash of WIDEN_*_EXPR. --- gcc/fold-const.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 7838f32cc26..eeadc8db9f6 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -4123,7 +4123,7 @@ operand_compare::hash_operand (const_tree t, inchash::hash &hstate, hash_operand (TREE_OPERAND (t, 0), one, flags); hash_operand (TREE_OPERAND (t, 1), two, flags); hstate.add_commutative (one, two); - hash_operand (TREE_OPERAND (t, 2), two, flags); + hash_operand (TREE_OPERAND (t, 2), hstate, flags); return; }