From patchwork Wed Aug 21 14:48:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 1974988 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axis.com header.i=@axis.com header.a=rsa-sha256 header.s=selector1 header.b=PHZHX5mH; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wpq3D6WbNz1yYZ for ; Thu, 22 Aug 2024 00:48:56 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE3A438708C8 for ; Wed, 21 Aug 2024 14:48:54 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazlp170120003.outbound.protection.outlook.com [IPv6:2a01:111:f403:c200::3]) by sourceware.org (Postfix) with ESMTPS id 9D3FE385E003 for ; Wed, 21 Aug 2024 14:48:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D3FE385E003 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=axis.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9D3FE385E003 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c200::3 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1724251714; cv=pass; b=lKJen91Ej01ixEeAO9IZN5W6BqigtmvAqjfZv2kY9JQDD9vBxEDKbJtGE51k10TjZr3k7DR/vTi/RMjcP9bTppc63CzNr2iUNxbBigiUqN9tsS6JorKdSh40kG1k8KAFPiYHVxaElHtipTcuQLdIoBDy+JlP/kQ4+e9BNTVcEg8= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1724251714; c=relaxed/simple; bh=LFEZBvDQoe6cRXIAuRz7zW/FXftWawo88O+hJBMvbYg=; h=DKIM-Signature:From:To:Subject:MIME-Version:Message-ID:Date; b=J34HFPt7JNEqRwSqchxtv0k9pJ2rx3m1Fs2s4vtNW1zoynQBN4m3mZx+IWf8S8y4xr+SxOUBnZ6KOkiHQwTHOpAsOvA+fOrTTmSD4tKRh/j4QsTeFFbzMjwhd5iGUGIQeuLy3vGo9hgDCcPaw6XM6na0qr0xUnP9KXdUFn/R07I= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IcCDknPAMRPpqpqSt+MJ8B5g6AyK4Hkcdx3RuF07wY0VfPjCCQAzGXTGzYEQtTXZ8/20TM5lcnPKYNo2hLOCMNAxVnOkDeJ3AxpB8U71iffJqUVP03448EK5PUNadmMhlrenOVVY+24Gsr7F9q3mW55b8qrrTRjAiTvkT6krPfSwHve9i8hy4ALQ1laoVwqBCIAGUIyf53nhKoIqGJfdiZ6BWa9OSY9BsmlFtT2NTtNnee682BcRfybqjChO+3kvMWgkU87Dj2Dhz8bL1N1FN7KypNRcO1toM9C2cYMmr7O4vXef+I3BU3TPQpY4HZ1VTdAVau4Dhowp9N8hxO+eNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Dm7VCeDm7RsSBQew3T45oR28ETKX8neCcOs+l2oGhKU=; b=KkjEUag0N3ymDnjeVJWq7031RjFUC6JOmnYTJMCnXtvEXZlyUjNOcVXSgGcLwZnGvp38niyonCt3ym8w5SpKOF3GjGFvGH94YmZKcXSLjM17EhfCYa9qhUupCZrS3TTxq/Ryq/nIP4W0kskN3+/kRnFDy7boqnCqiUBUidGXivKFxWDPOo4jcxtsnkP9z9TDGXgb0Z7yjajghASpP3rGrHVh4oCCJ2IaRhn72UMpgQCV4VSAqX5madp+9l1IvlczYIW3riDsLqMmKNpxck28X3xa1kDhyARt9VOExrdQCPRE5BbAtIaDbCHKupAeItxThSqaXC+qqMEmqyeOcn0VIg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=arm.com smtp.mailfrom=axis.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=axis.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dm7VCeDm7RsSBQew3T45oR28ETKX8neCcOs+l2oGhKU=; b=PHZHX5mHncoBIgXvpr8iW5OovWGr5DiV/5L4cyLOhl+CwJtNT2eiS+v9v9kEw8Sjqs1KysNCieTgyi5/naV/iZA3Lqa6d82UIQdw3Tbn8/NvIdz4EW62LNDJBFlYz41M5BbJRjZMbA7+HqHMxW5QgKAs3PX3se8/uqMsaTF5aKY= Received: from AS9PR06CA0028.eurprd06.prod.outlook.com (2603:10a6:20b:462::16) by GV1PR02MB10759.eurprd02.prod.outlook.com (2603:10a6:150:160::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.19; Wed, 21 Aug 2024 14:48:18 +0000 Received: from AMS0EPF000001B6.eurprd05.prod.outlook.com (2603:10a6:20b:462:cafe::1e) by AS9PR06CA0028.outlook.office365.com (2603:10a6:20b:462::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.25 via Frontend Transport; Wed, 21 Aug 2024 14:48:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 195.60.68.100) smtp.mailfrom=axis.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=axis.com; Received-SPF: Pass (protection.outlook.com: domain of axis.com designates 195.60.68.100 as permitted sender) receiver=protection.outlook.com; client-ip=195.60.68.100; helo=mail.axis.com; pr=C Received: from mail.axis.com (195.60.68.100) by AMS0EPF000001B6.mail.protection.outlook.com (10.167.16.170) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7897.11 via Frontend Transport; Wed, 21 Aug 2024 14:48:17 +0000 Received: from se-mail02w.axis.com (10.20.40.8) by se-mail01w.axis.com (10.20.40.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 21 Aug 2024 16:48:17 +0200 Received: from se-intmail01x.se.axis.com (10.0.5.60) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server id 15.1.2507.39 via Frontend Transport; Wed, 21 Aug 2024 16:48:17 +0200 Received: from pchp3.se.axis.com (pchp3.se.axis.com [10.88.21.53]) by se-intmail01x.se.axis.com (Postfix) with ESMTP id 8B0FF306; Wed, 21 Aug 2024 16:48:17 +0200 (CEST) Received: by pchp3.se.axis.com (Postfix, from userid 171) id 868AA20432; Wed, 21 Aug 2024 16:48:17 +0200 (CEST) From: Hans-Peter Nilsson To: CC: , , Subject: [PATCH v2] combine.cc (make_more_copies): Copy attributes from the original pseudo, PR115883 MIME-Version: 1.0 Message-ID: <20240821144817.868AA20432@pchp3.se.axis.com> Date: Wed, 21 Aug 2024 16:48:17 +0200 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001B6:EE_|GV1PR02MB10759:EE_ X-MS-Office365-Filtering-Correlation-Id: 6fa80766-dfcd-403a-2452-08dcc1f04b5c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: =?iso-8859-1?q?sfAtGHmJuzvwSbVB2yDdrp7uBS?= =?iso-8859-1?q?HSrX+vj4zvsXiQfhmW3j/OLVrZXnftznm1jT/Amr61OZb5HYz/eUpy3mObnm?= =?iso-8859-1?q?oI/mxBXfbu4wlP1ttaCc+DjqPOqoQOS/EFBlS2uq25ThGPuZTaHDaVlOqr0e?= =?iso-8859-1?q?26rwuS5Uc3EuIbI8fNSH0k+MCyfLplV7rdNuSgIZ683UUNVtyi1dXzl/8zJt?= =?iso-8859-1?q?VyixejHLzL0qSEUROZINmEjDa6HReH3kvmDfA7IoIbTZIIlNeogrlPKvPj1s?= =?iso-8859-1?q?KBjjYxUCUZGRaG0Oh5w0IZQm+KzSCrTVTg05d18ewfxIsFIPQehnV11tCSJy?= =?iso-8859-1?q?genXe0wLtoTeFJiHcjAv8WgqoCegA5X2yEE8+bUpERgF5AKwWd81bkarO4T+?= =?iso-8859-1?q?k+md6mhla757NCjtFgXUQ+ePvbiSC/wYHfSVuDH+fmSyzy5BYG91qcleLo4G?= =?iso-8859-1?q?JRccVoUsIuz1UsvCa/0UsHW2SnT80XwYUiVNoWftwMJw+BTPIMHoYEcOnCJa?= =?iso-8859-1?q?kBXCBKs0MIbqEyC7LxMc7eTYi2ISwwNKa3GTXIVgcuB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859-1?q?iJm9f9kytdGB9IlYdZQxPsPw=3D=3D?= X-Forefront-Antispam-Report: CIP:195.60.68.100; CTRY:SE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.axis.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024); DIR:OUT; SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2024 14:48:17.9940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6fa80766-dfcd-403a-2452-08dcc1f04b5c X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=78703d3c-b907-432f-b066-88f7af9ca3af; Ip=[195.60.68.100]; Helo=[mail.axis.com] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001B6.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR02MB10759 X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_PASS, SPF_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org The only thing that's changed with the patch in v2 since the first version (pinged once) is the commit message. CC to the nexts-of-kin as a heads-up. Regtested cross to cris-elf and native x86_64-linux-gnu at r15-3043-g64028d626a50. The gcc.dg/guality/pr54200.c magically being fixed was also noticed at an earlier test-run, at r15-1880-gce34fcc572a0. I see on gcc-testresults that this test fails for several targets. Ok to commit? -- >8 -- The first of the late-combine passes, propagates some of the copies made during the (in-time-)combine pass in make_more_copies into the users of the "original" pseudo registers and removes the "old" pseudos. That effectively removes attributes such as REG_POINTER, which matter to LRA. The quoted PR is for an ICE-manifesting bug that was exposed by the late-combine pass and went back to hiding with this patch until commit r15-2937-g3673b7054ec2, the fix for PR116236, when it was actually fixed. To wit, this patch is only incidentally related to that bug. In other words, the REG_POINTER attribute should not be required for LRA to work correctly. This patch merely corrects state for those propagated register-uses to ante late-combine. For reasons not investigated, this fixes a failing test "FAIL: gcc.dg/guality/pr54200.c -Og -DPREVENT_OPTIMIZATION line 20 z == 3" for x86_64-linux-gnu. PR middle-end/115883 * combine.cc (make_more_copies): Copy attributes from the original pseudo to the new copy. --- gcc/combine.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gcc/combine.cc b/gcc/combine.cc index 3b50bc3529c4..6e6e710aae08 100644 --- a/gcc/combine.cc +++ b/gcc/combine.cc @@ -15102,6 +15102,12 @@ make_more_copies (void) continue; rtx new_reg = gen_reg_rtx (GET_MODE (dest)); + + // The "original" pseudo copies have important attributes + // attached, like pointerness. We want that for these copies + // too, for use by insn recognition and later passes. + set_reg_attrs_from_value (new_reg, dest); + rtx_insn *new_insn = gen_move_insn (new_reg, src); SET_SRC (set) = new_reg; emit_insn_before (new_insn, insn);