From patchwork Fri Jan 19 10:25:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyrill Tkachov X-Patchwork-Id: 863457 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-471647-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="DBFoXdD7"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zNH6D1Cmpz9s72 for ; Fri, 19 Jan 2018 21:25:55 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=vXIuOoP3qH8U1LfnJekwsxmIsLuS8MOX8xeCx4bwwNwIws g03yK1cxvvlASJWHHNPC/5q3O7Q2H9dMF82G6OeIKWtQ3v04ErQkKxiidcTHmOBH 33Y1cHDTJeE3dtCl6iYHmg/FuvIJEUSKK7H1Qc+aA94JQrXxwvpfH588x+2RM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=NyPm6x9E/Iqyw3fymrku+np8Zf8=; b=DBFoXdD78R2yCq5Hq0y5 BHmaG+0+GKIIp8qqfkgenpdobg61WQ1LId9P5LYLuTl2LYzJ9dzv7Zj9AdcyLTaR GS3Uolp8pWSRaqOxfFQ6hW9OxNZ+PyCFZaGXWk6/JtWNWcAtKjD9JnNBUIPreVSp VQq3lHAoySxo8D9qg5SmDSA= Received: (qmail 93200 invoked by alias); 19 Jan 2018 10:25:48 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 93189 invoked by uid 89); 19 Jan 2018 10:25:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 19 Jan 2018 10:25:46 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6101880D for ; Fri, 19 Jan 2018 02:25:44 -0800 (PST) Received: from [10.2.207.77] (e100706-lin.cambridge.arm.com [10.2.207.77]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0F3F63F41F for ; Fri, 19 Jan 2018 02:25:43 -0800 (PST) Message-ID: <5A61C7A6.7020402@foss.arm.com> Date: Fri, 19 Jan 2018 10:25:42 +0000 From: Kyrill Tkachov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [PATCH][arm] Fix gcc.target/arm/pr40956.c Hi all, The scan-assembler tests here check for MOVS for Thumb1 and MOV for Thumb2, but in fact there's no reason why we wouldn't generate MOVS for Thumb2 as well, it really depends on a lot of optimisation decisions. The only behaviour we want to test is that we move a 0 constant into a register only once, which can be achieved with either MOV or MOVS. Simplify the check by always checking for either MOV or MOVS. Committing to trunk. Thanks, Kyrill 2018-01-19 Kyrylo Tkachov * gcc.target/arm/pr40956.c: Adjust scan-assembler pattern. diff --git a/gcc/testsuite/gcc.target/arm/pr40956.c b/gcc/testsuite/gcc.target/arm/pr40956.c index 4fefa49a5878a90e3a78db7d3df1015a36d0897f..7429272a8c26a00ed40ead45d8d5737986e4bb0a 100644 --- a/gcc/testsuite/gcc.target/arm/pr40956.c +++ b/gcc/testsuite/gcc.target/arm/pr40956.c @@ -1,8 +1,7 @@ /* { dg-options "-Os -fpic" } */ /* { dg-require-effective-target fpic } */ /* Make sure the constant "0" is loaded into register only once. */ -/* { dg-final { scan-assembler-times "movs\[\\t \]*r., #0" 1 { target arm_thumb1 } } } */ -/* { dg-final { scan-assembler-times "mov\[\\t \]*r., #0" 1 { target { ! arm_thumb1 } } } } */ +/* { dg-final { scan-assembler-times "movs?\[\\t \]*r., #0" 1 } } */ int foo(int p, int* q) {