From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2081.outbound.protection.outlook.com [40.107.21.81]) by sourceware.org (Postfix) with ESMTPS id 5AE5D3858C98 for ; Fri, 5 Apr 2024 02:06:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5AE5D3858C98 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 5AE5D3858C98 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.21.81 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1712282767; cv=pass; b=Wx4mPFVDvDqCnqAal4zDXp50bUT7ddsTl4k7LDAVkKj4g8EjlS/OKGaD8YROG/kGb2+Bus300dvIJdvIPehA3Tp6mN9CsCeUvcEeD1fWyj+saXuKOGtfELVpcuqgwVG9N+vQGvnFz8s/qDKzJH46oAcwRItEFycePKKlmNHFHL0= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1712282767; c=relaxed/simple; bh=MWatcbh992PDyx5+pLF1IrCuUM3iqpzg7veHPMlAwpo=; h=DKIM-Signature:From:To:Subject:MIME-Version:Message-ID:Date; b=Wt7ZbCbFNAe7I7BL9pYhr44PBR7LcqV/e5mdWzDhaETo6amBPPuEiy2VfjatGrQe610aHCoMFHW9GTqHGWWFxKl75prSzhdScwYPTEjfEGasHvO5eFVnEvCDHsa6HTmjfWQ/Hq5F0ivBb9P5EWqG4/eBoV1F9Nj3anwmGELmecQ= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hv5knSUjoj+bz3VRPu6oi2sRx3rJqaEOp/THunvy0un2mu7YEGANtuBR4DikL0fVFBKmtytK9t975ANId/7IONICz7OjoVAi/YJSBvMJWjA5CAwGfDuA5NlJa2s31JWhhCJC5b1pCJZ49j7qFPFYsA/1CJr7jLv6FXh8VGo7pdbdsKCAZSCdjKH6GccHVzgoOia29MWlz1qeU8hE3B6RCjmQxMThKHJXV8avS54XXBseazeGpxuUcMTQdiIDQMsRsUdrBEVgYMnTo9anIqvq+sPM1tMoIAKb2wNcpWCZzkBegQzlNri8kYAPjyUZdyETILLvtl0xfueTLTL9UQAvWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=A5ILwERmbSL+d8AOZpkGXeqeE+EQn9TzMZ33NNddaWk=; b=TdYnjgytJKdxSINmbajejgDueK6SxJP71S/Fgmj7TW6kFyvvLGrh54P2ir5NloXskSQIB2SlusddmCxKD4cQL/+knNUgHsMuPPk+H3io/VUWkENTNc5SnD9zn0E1XLDQTXfNMoj2EboqPW6EbFS0o3wc5V39uiVIAJ2a2T2gfp9vofofKLrGaZdZKBARLldawau4H8j13zsRVS6MoFH5k9kt86GWxnDYn8HDV4vuyT50x2p4EFZxM2mUElCyBonbDyuG8kuGwwFOmevbHq2cGlN+mvx9eRScDkUZrcsRR4A0fKDRYdJJXVu1v7OlNcc2WpcqNQzvgKSKVITgughYZw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 195.60.68.100) smtp.rcpttodomain=gcc.gnu.org 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=A5ILwERmbSL+d8AOZpkGXeqeE+EQn9TzMZ33NNddaWk=; b=kJ644qqpKXaQSvTp2qzngzmVt7uakl4Rsx5x2GCMsfjVgenA0PwCcGxlimlcJKXrWlD7yqNfXgYchyx8h1ywUUdB7GyM3j5TNsxwa6j5OVe7KDpSKuNeLMs3iVjxvHUl5CjPMOnpTdRq72Fy/PRk97OEupoWfMw/5gGDK0XelEc= Received: from AS8P251CA0028.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:2f2::24) by DBAPR02MB6245.eurprd02.prod.outlook.com (2603:10a6:10:19a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.47; Fri, 5 Apr 2024 02:06:02 +0000 Received: from AMS0EPF00000199.eurprd05.prod.outlook.com (2603:10a6:20b:2f2:cafe::54) by AS8P251CA0028.outlook.office365.com (2603:10a6:20b:2f2::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.30 via Frontend Transport; Fri, 5 Apr 2024 02:06:02 +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 AMS0EPF00000199.mail.protection.outlook.com (10.167.16.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Fri, 5 Apr 2024 02:06:02 +0000 Received: from se-mail02w.axis.com (10.20.40.8) by se-mail02w.axis.com (10.20.40.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 5 Apr 2024 04:06:01 +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.2375.34 via Frontend Transport; Fri, 5 Apr 2024 04:06:01 +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 CF1E93BA0; Fri, 5 Apr 2024 04:06:01 +0200 (CEST) Received: by pchp3.se.axis.com (Postfix, from userid 171) id C492220432; Fri, 5 Apr 2024 04:06:01 +0200 (CEST) From: Hans-Peter Nilsson To: CC: Subject: [COMMITTED] testsuite/gcc.target/cris/pr93372-2.c: Handle xpass from combine improvement MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT Message-ID: <20240405020601.C492220432@pchp3.se.axis.com> Date: Fri, 5 Apr 2024 04:06:01 +0200 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF00000199:EE_|DBAPR02MB6245:EE_ X-MS-Office365-Filtering-Correlation-Id: bacb70c4-71c9-4a95-34c6-08dc5514f1b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AwV/B3YtMI6bJbTc0Y4kOr473BLuvzPbwihjZFxShcmVH6juNZBJSpi34tbeH/GnLjxHCcHAutZAs+k0T2xmpsyD/RqiDGgC+dsMQ7dtlBVusAVy2GgLjUyAdFRhcuaJ4h7SsfT/fP60U2YH0ePeW8tXFHk//GgKVv671QijnrNXNA0vZIFa9XdJdeHoH30C60wl63akEJPcxaz/mQL2wFwGPxIDJu5I/gMTghY7xPZ1JNoQxibgx+pGHQJN0yXEw284+qShVU7Pnp09YnKdELn/0rf4Itf1BrbRORudQKZQiyVNU8vtlIbYVa6gRI9lfma7loDQkI3xOMngsvQJ0FmuEqZXWK0dPdEC6PVmDNwlhvX55bgAyazs6HGwRxUhAYVUpLK5fO+L7JZBrOydbJHMGT0KCz2PGeY2CkAAfK4Rvw18vCY/B7Kt7lk+kdnPNIUZu7luuIWhRKSmFfWJxV70TgtLZbNGcvwF96s2oVLGccNBLIkfi9AQWPP4LCbeiEb8I3BJnfRbQ+TJtF7L8d2V6zrOWa+oz9JW77bmJi78nDu1Qbs5DsnWqXNd7vBe2UIHiCDoStowtCpO0+j69i300zzdXuf3F/ujtHwy5BnnERZrvTq11bnorSaKHgDidseEI/9lJlc42gvmGqWV7fRbbdyDuJA+jbISLSisBxhAbe0XgO9Bhe/8Gf9gH9bIY5vpHWQi+SjEQnnSAfZZRw== 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:(13230031)(376005)(82310400014)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2024 02:06:02.2256 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bacb70c4-71c9-4a95-34c6-08dc5514f1b6 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: AMS0EPF00000199.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR02MB6245 X-Spam-Status: No, score=-11.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 List-Id: The xpassing change in generated code was as follows, at r14-9788-gb7bd2ec73d66f7 (where I locally applied a revert to verify that this suspect was the cause). That was so much of an improvement that I had to share it! Worth the testsuite churn anyway. :) Segher, if you end up reverting r14-9692-g839bc42772ba7a (as unfortunately seems not unlikely), then please also revert this commit: r14-9799-g4c8b3600c4856f7915281ae3ff4d97271c83a540. --- pr93372-2.s.pre 2024-04-05 01:49:47.985685902 +0200 +++ pr93372-2.s.post 2024-04-05 01:42:02.296489730 +0200 @@ -5,12 +5,9 @@ .global _f .type _f, @function _f: - move.d $r10,$r9 - sub.d $r11,$r9 - cmp.d $r11,$r10 - seq $r10 - move.d $r10,[$r12] - cmpq 0,$r9 + sub.d $r11,$r10 + seq $r9 + move.d $r9,[$r12] ret sge $r10 -- >8 -- After r14-9692-g839bc42772ba7a, a sequence that actually looks optimal is now emitted, observed at r14-9788-gb7bd2ec73d66f7. This caused an XPASS for this test. While adjusting the test, better also guard it against regressions by checking that there are no redundant move insns. That's the only test that's improved to the point of affecting test-patterns. E.g. pr93372-5.c (which references pr93372-2.c) is also improved, though it retains a redundant compare insn. (PR 93372 was about regressions from the cc0 representation; not further improvement like here, thus it's not tagged. Though, I did not double-check whether this actually *was* a regression from cc0.) * gcc.target/cris/pr93372-2.c: Tweak scan-assembler checks to cover recent combine improvement. --- gcc/testsuite/gcc.target/cris/pr93372-2.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gcc/testsuite/gcc.target/cris/pr93372-2.c b/gcc/testsuite/gcc.target/cris/pr93372-2.c index 912069c018d5..2ef6471a990b 100644 --- a/gcc/testsuite/gcc.target/cris/pr93372-2.c +++ b/gcc/testsuite/gcc.target/cris/pr93372-2.c @@ -1,19 +1,20 @@ /* Check that eliminable compare-instructions are eliminated. */ /* { dg-do compile } */ /* { dg-options "-O2" } */ -/* { dg-final { scan-assembler-not "\tcmp|\ttest" { xfail *-*-* } } } */ -/* { dg-final { scan-assembler-not "\tnot" { xfail cc0 } } } */ -/* { dg-final { scan-assembler-not "\tlsr" { xfail cc0 } } } */ +/* { dg-final { scan-assembler-not "\tcmp|\ttest" } } */ +/* { dg-final { scan-assembler-not "\tnot" } } */ +/* { dg-final { scan-assembler-not "\tlsr" } } */ +/* We should get just one move, storing the result into *d. */ +/* { dg-final { scan-assembler-times "\tmove" 1 } } */ int f(int a, int b, int *d) { int c = a - b; - /* Whoops! We get a cmp.d with the original operands here. */ + /* We used to get a cmp.d with the original operands here. */ *d = (c == 0); - /* Whoops! While we don't get a test.d for the result here for cc0, - we get a sequence of insns: a move, a "not" and a shift of the - subtraction-result, where a simple "spl" would have done. */ + /* We used to get a suboptimal sequence, but now we get the optimal "sge" + (a.k.a "spl") re-using flags from the subtraction. */ return c >= 0; } -- 2.30.2