From patchwork Tue Feb 3 23:41:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaz Kojima X-Patchwork-Id: 436072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 2C8C21401D0 for ; Wed, 4 Feb 2015 10:42:06 +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:date :message-id:to:subject:from:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=BMXosEvKpzldEanI 3dCqhcHcArMqM0UKtIJ/tSE8+wm5k+cOvb5dAfLgpooqgu5fehETL4fJkeZEyYu5 ytQ41yj4Kk0wnZ6Eq2orGkh/9dhnj0ErbYGvVWUMwjKRyKCp3Av5BfIwLnf0JFg8 oRul1BeJlA8GsiLkIDEdnl5aKaQ= 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:date :message-id:to:subject:from:mime-version:content-type :content-transfer-encoding; s=default; bh=RZ+azPdrV7MNuYOiYVbH/h YtOsA=; b=eiy7gy5iAzEsG5kAqWuJQCuL35xPrEkth3M/9IrVGwlFr+fjd/8bZq Cw8PePVX3PNsEl+zkQcyyWjnXuxswQ60jGIuLUw42mTzSDok+kQDCeKDdumgdz8x o9Hmn5DLxysd6/xVxTNVrsTfvmPVHglZEVIEYel8SmQnalgnFtDAo= Received: (qmail 6878 invoked by alias); 3 Feb 2015 23:41:35 -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 6869 invoked by uid 89); 3 Feb 2015 23:41:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mo-sw.iij4u.or.jp Received: from mo-sw1501.iij4u.or.jp (HELO mo-sw.iij4u.or.jp) (210.130.239.241) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 03 Feb 2015 23:41:33 +0000 Received: by mo-sw.iij4u.or.jp (4u-mo-sw1501) id t13NfT9O023036; Wed, 4 Feb 2015 08:41:29 +0900 Received: from localhost (132.8.30.125.dy.iij4u.or.jp [125.30.8.132]) by mbox.iij4u.or.jp (4u-mbox1501) id t13NfSb5029312; Wed, 4 Feb 2015 08:41:28 +0900 Date: Wed, 04 Feb 2015 08:41:28 +0900 (JST) Message-Id: <20150204.084128.280634107.kkojima@rr.iij4u.or.jp> To: gcc-patches@gcc.gnu.org Subject: [RFC testsuite] Fix PR64850, tweak acc_on_device* tests From: Kaz Kojima Mime-Version: 1.0 X-IsSubscribed: yes Hi, Several goacc/acc_on_device tests fail for a few targets: hppa2.0w-hp-hpux11.11 (PR testsuite/64850) https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg02659.html m68k-unknown-linux-gnu https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg02960.html sh4-unknown-linux-gnu https://gcc.gnu.org/ml/gcc-testresults/2015-01/msg02930.html Also they fail with special options x86_64-unknown-linux-gnu -fpic -mcmodel=large https://gcc.gnu.org/ml/gcc-testresults/2015-02/msg00198.html Those tests scan .expand rtl dumps to get the number of calls for acc_on_device function. For almost targets, the call rtx looks something like (call (mem:QI (symbol_ref:SI ("acc_on_device") [flags 0x41] ) [0 acc_on_device S1 A8]) and tests use the regular expression "\\\(call \[^\\n\]*\\\"acc_on_device" to detect it. This expression doesn't match with the corresponding call rtx (call (mem:SI (symbol_ref/v:SI ("@acc_on_device") [flags 0x41] ) [0 acc_on_device S4 A32]) for hppa and something like (call (mem:QI (reg/f:SI 33) [0 acc_on_device S1 A8]) for m68k and sh. All call rtxes have the function name in the alias set of its mem rtx and it seems that the regular expression "\\\(call \[^\\n\]* acc_on_device" works for all cases. The attached patch is tested on i686-pc-linux-gnu and sh4-unknown-linux-gnu. Regards, kaz --- PR testsuite/64850 * gcc.dg/goacc/acc_on_device-1.c: Use a space instead of \\\" in the expression to find calls. * c-c++-common/goacc/acc_on_device-2.c: Likewise. * c-c++-common/goacc/acc_on_device-2-off.c: Likewise. * gfortran.dg/goacc/acc_on_device-1.f95: Likewise. * gfortran.dg/goacc/acc_on_device-2.f95: Likewise. * gfortran.dg/goacc/acc_on_device-2-off.f95: Likewise. diff --git a/c-c++-common/goacc/acc_on_device-2-off.c b/c-c++-common/goacc/acc_on_device-2-off.c index 25d21ad..ea31047 100644 --- a/c-c++-common/goacc/acc_on_device-2-off.c +++ b/c-c++-common/goacc/acc_on_device-2-off.c @@ -20,6 +20,6 @@ f (void) } /* Without -fopenacc, we're expecting one call. - { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 1 "expand" } } */ + { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 1 "expand" } } */ /* { dg-final { cleanup-rtl-dump "expand" } } */ diff --git a/c-c++-common/goacc/acc_on_device-2.c b/c-c++-common/goacc/acc_on_device-2.c index d5389a9..2f4ee2b 100644 --- a/c-c++-common/goacc/acc_on_device-2.c +++ b/c-c++-common/goacc/acc_on_device-2.c @@ -24,6 +24,6 @@ f (void) perturbs expansion as a builtin, which expects an int parameter. It's fine when changing acc_device_t to plain int, but that's not what we're doing in . - { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 0 "expand" { xfail c++ } } } */ + { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 0 "expand" { xfail c++ } } } */ /* { dg-final { cleanup-rtl-dump "expand" } } */ diff --git a/gcc.dg/goacc/acc_on_device-1.c b/gcc.dg/goacc/acc_on_device-1.c index 1a0276e..d0dbc82 100644 --- a/gcc.dg/goacc/acc_on_device-1.c +++ b/gcc.dg/goacc/acc_on_device-1.c @@ -15,6 +15,6 @@ f (void) } /* Unsuitable to be handled as a builtin, so we're expecting four calls. - { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 4 "expand" } } */ + { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 4 "expand" } } */ /* { dg-final { cleanup-rtl-dump "expand" } } */ diff --git a/gfortran.dg/goacc/acc_on_device-1.f95 b/gfortran.dg/goacc/acc_on_device-1.f95 index 9dfde26..0126d9c 100644 --- a/gfortran.dg/goacc/acc_on_device-1.f95 +++ b/gfortran.dg/goacc/acc_on_device-1.f95 @@ -17,6 +17,6 @@ logical function f () end function f ! Unsuitable to be handled as a builtin, so we're expecting four calls. -! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 4 "expand" } } +! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 4 "expand" } } ! { dg-final { cleanup-rtl-dump "expand" } } diff --git a/gfortran.dg/goacc/acc_on_device-2-off.f95 b/gfortran.dg/goacc/acc_on_device-2-off.f95 index cf28264..0a4978e 100644 --- a/gfortran.dg/goacc/acc_on_device-2-off.f95 +++ b/gfortran.dg/goacc/acc_on_device-2-off.f95 @@ -34,6 +34,6 @@ logical (4) function f () end function f ! Without -fopenacc, we're expecting one call. -! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 1 "expand" } } +! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 1 "expand" } } ! { dg-final { cleanup-rtl-dump "expand" } } diff --git a/gfortran.dg/goacc/acc_on_device-2.f95 b/gfortran.dg/goacc/acc_on_device-2.f95 index 7730a60..43ad022 100644 --- a/gfortran.dg/goacc/acc_on_device-2.f95 +++ b/gfortran.dg/goacc/acc_on_device-2.f95 @@ -35,6 +35,6 @@ end function f ! With -fopenacc, we're expecting the builtin to be expanded, so no calls. ! TODO: not working. -! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]*\\\"acc_on_device" 0 "expand" { xfail *-*-* } } } +! { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 0 "expand" { xfail *-*-* } } } ! { dg-final { cleanup-rtl-dump "expand" } }