From patchwork Tue Apr 12 12:38:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 1616251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=ZMBU9bv/; dkim-atps=neutral Authentication-Results: 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=) 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 RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kd50n4ccZz9sBy for ; Tue, 12 Apr 2022 22:40:24 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1B659385803E for ; Tue, 12 Apr 2022 12:40:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1B659385803E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1649767222; bh=kWpE+5FLGELqWYokgMNtfWwY0A0N/ovLKzTuraq2JjM=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ZMBU9bv/58Nt9zEdgUFYjwaYoZrJ0q4wi5RNRy2SiAtILBjLkWFq0Zn3h+I5KbeW3 ppjB9VRGVPYxfnTDD6C0gkSPV7mUSVuVwXmB1rCLokF7X3MC+mYE/vwCxwVo45i3ag fpnOMnQy+xfGdhWn3sAXVi78ejxGkBm5Y1CzufG8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id B72DD385801B for ; Tue, 12 Apr 2022 12:39:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B72DD385801B Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3A5FD150C; Tue, 12 Apr 2022 05:39:12 -0700 (PDT) Received: from e126323.arm.com (unknown [10.57.40.209]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B169A3F70D; Tue, 12 Apr 2022 05:39:11 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: [pushed] arm: fix testsuite failure of reg_equal_test.c [PR101755] Date: Tue, 12 Apr 2022 13:38:52 +0100 Message-Id: <20220412123852.3186212-1-rearnsha@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Richard Earnshaw via Gcc-patches From: Richard Earnshaw Reply-To: Richard Earnshaw Cc: Richard Earnshaw Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The test failure in PR101755 is due to the gimple optimizers getting smarter. But really we are just testing that RTL expansion is doing the right thing and annotating a constant accordingly. So rework the test to use GIMPLE input and simplify the code entirely. Also, this test only ever worked on architecture versions with the MOVW/MOVT instructions, so check for this before running. gcc/testsuite/ChangeLog: PR target/101755 * gcc.target/arm/reg_equal_test.c: Convert to gimple test. Restrict to architectures with MOVW/MOVT. --- gcc/testsuite/gcc.target/arm/reg_equal_test.c | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/reg_equal_test.c b/gcc/testsuite/gcc.target/arm/reg_equal_test.c index 58fa9dd9b94..d87c75cc27c 100644 --- a/gcc/testsuite/gcc.target/arm/reg_equal_test.c +++ b/gcc/testsuite/gcc.target/arm/reg_equal_test.c @@ -1,24 +1,15 @@ /* { dg-do compile } */ -/* { dg-options "-O1 -fdump-rtl-expand" } */ +/* { dg-options "-fgimple -O1 -fdump-rtl-expand" } */ +/* { dg-skip-if "" { ! { arm_thumb2_ok || arm_thumb1_movt_ok } } } */ -extern void abort (void); -unsigned int a = 1; - -int -main (void) +void __GIMPLE (ssa,startwith ("expand")) +x () { - unsigned int b, c, d; - - if (sizeof (int) != 4 || (int) 0xc7d24b5e > 0) - return 0; - - c = 0xc7d24b5e; - d = a | -2; - b = (d == 0) ? c : (c % d); - if (b != c) - abort (); + unsigned int d; - return 0; + __BB(2,guessed_local(1073741824)): + d_1 = 3352447838u; + return; } /* { dg-final { scan-rtl-dump "expr_list:REG_EQUAL \\(const_int -942519458" "expand" } } */