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: 52811 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 2FC413858C51 for ; Tue, 12 Apr 2022 12:40:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FC413858C51 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1649767231; 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=umrrAB8m+av7zerNR0KFe+Vryydat02GymI/qMP/aI84ghmVtctb4+Xdd93OikzKD LeNzrcp+/9XErQrE5GwKP/dYKIfmYVXGzupo7qmN4pcvowyAB7m3x7aKoaUDvXGs2L gIcAtutpjdHbDHKjFJaJ7WLFdqryYUCQf3+rjGj0= 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+patchwork=sourceware.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" } } */