From patchwork Sun Mar 25 06:21:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 890613 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-475422-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=mentor.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Q5MCiDog"; 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 4086cG1XF4z9s0R for ; Sun, 25 Mar 2018 17:21:30 +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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; q=dns; s=default; b=Ix0WRGKZDY7uc9mxs 17sArVaaO0M48SmM35jTyWdGogk2aHfGBrrom0gEn2NSXkI4llcF1lFMqq0AsfVZ r8PuF3G4hkcPfllLkqcdcAe3HxRkDqpQeRCPy0FECurezW15TVKdfAt3sm9b6tQa Szllzg8xakNmcke6hGQXYORPbw= 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 :subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type; s=default; bh=9uCcFyWL+9qXdWcNkrUDwVF 6v0k=; b=Q5MCiDogVqQNT+lXC236ewJpr1H+Xq8bgXwezoUEyEu9vGtoCaBHaFy VG8Vd54r+mHJZPVjYwV+1BQpWdCGXZF/vy5SRWTl88TF0UxXDYAKCc1pT9bcB3qb Hkhejt/vkNBn/gNbsw5eqfFQnXNogDqqEZI6uUDyOAiuprO44+vU= Received: (qmail 49751 invoked by alias); 25 Mar 2018 06:21:20 -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 49296 invoked by uid 89); 25 Mar 2018 06:21:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS, URIBL_RED autolearn=ham version=3.3.2 spammy=HTo:D*cz, sk:tom@cod, sk:tomcod, tomcodesourcerycom X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Mar 2018 06:21:16 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1ezz1h-0002t1-RC from Tom_deVries@mentor.com ; Sat, 24 Mar 2018 23:21:09 -0700 Received: from [172.30.72.37] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Sun, 25 Mar 2018 07:21:06 +0100 Subject: [testsuite, committed] Make scan pattern more precise in vrp104.c To: =?utf-8?q?Martin_Li=C5=A1ka?= , Rainer Orth CC: Richard Biener , GCC Patches , Jan Hubicka , Martin Jambor References: <8caac5fa-2f65-2dcf-3444-d48a7ca3d306@suse.cz> <615dfc0a-aded-22e5-333e-f613eb577c7c@suse.cz> <0df53cfc-9ce6-8433-0e82-80f4ee40f9f0@suse.cz> From: Tom de Vries Message-ID: <379c2170-fb1b-9051-a709-770f4d71fbd3@mentor.com> Date: Sun, 25 Mar 2018 08:21:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) [ was: Re: [PATCH][RFC] Make expansion of balanced binary trees of switches on tree level. ] On 08/30/2017 01:10 PM, Martin Liška wrote: > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c > index aa3b00a1204..0a952267b29 100644 > --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c > +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c > @@ -1,6 +1,8 @@ > /* PR tree-optimization/18046 */ > -/* { dg-options "-O2 -fdump-tree-optimized" } */ > -/* { dg-final { scan-tree-dump-times "switch" 1 "switchlower" } } */ > +/* { dg-options "-O2 -fdump-tree-switchlower" } */ > +/* We scan for 2 switches as the dump file reports a transformation, > + IL really contains just a single. */ > +/* { dg-final { scan-tree-dump-times "switch" 2 "switchlower" } } */ > > void foo (void); > void bar (void); > A difference between the optimized and switchlower dumps, is that the switchlower dump contains a source file path: ... ;; Function test (test, funcdef_no=0, decl_uid=1964, cgraph_uid=0, symbol_order=0) beginning to process the following SWITCH statement (/home/vries/gcc_versions/devel/src/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c:14) : ------- switch (i_3(D)) [33.33%], case 1: [33.33%], case 2: [33.33%]> test (int i) { [local count: 1073741825]: switch (i_3(D)) [33.33%], case 1: [33.33%], case 2: [33.33%]> ... So, when I build and tested gcc in a directory containing the string switch, the scan check failed for me, because it triggered 3 times instead of 2: ... gcc.dg/tree-ssa/vrp104.c: pattern found 3 times FAIL: gcc.dg/tree-ssa/vrp104.c scan-tree-dump-times switchlower "switch" 2 ... Fixed by making the scan pattern more precise. [ The generic form of this problem is filed as PR82806 - Stabilize paths in assembler and dumps ] Committed. Thanks, - Tom [testsuite] Make scan pattern more precise in vrp104.c 2018-03-24 Tom de Vries * gcc.dg/tree-ssa/vrp104.c: Make scan-tree-dump-times pattern more precise. --- gcc/testsuite/gcc.dg/tree-ssa/vrp104.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c b/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c index 0a95226..d4691fc 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/vrp104.c @@ -2,7 +2,7 @@ /* { dg-options "-O2 -fdump-tree-switchlower" } */ /* We scan for 2 switches as the dump file reports a transformation, IL really contains just a single. */ -/* { dg-final { scan-tree-dump-times "switch" 2 "switchlower" } } */ +/* { dg-final { scan-tree-dump-times "switch \\(i_" 2 "switchlower" } } */ void foo (void); void bar (void);