From patchwork Mon Nov 5 10:44:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 197183 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]) by ozlabs.org (Postfix) with SMTP id 496C92C0087 for ; Mon, 5 Nov 2012 21:45:02 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1352717103; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=e+6h8foBqo+4W4BO8G3s o3spe00=; b=JhlBEKZOKYaBBqcO05mqA6vP/JFxLD4kmB/KoO7y0pMGLaE+geRY 7NhfxMFNZEswI96m4uUOfWqtPC+4kIrSbKKi69z6m6lI37IiLIIN6mcY/R+9vBed hqrYbDk7QKArswu1FILVHf7aX7kt+1NiTCWGzYI4ZBYhcN2gD3Bj+bw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=lctKi8AYdEbXf1gJ+oUYD1v/wrV8YP/iL0jm5xinOkGRbh9Dbpuff8mBFbmquu 9g0tXk4jynCXIEw1w1jcZSds+XMwlZCUXeguSRnlDMyD+McHuW422XzfrymaeUaD ws1lJ3hTSIlFiHQxhOUmPy/bsJusUje0kW49Lbdyw6JcY=; Received: (qmail 6848 invoked by alias); 5 Nov 2012 10:44:59 -0000 Received: (qmail 6839 invoked by uid 22791); 5 Nov 2012 10:44:58 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 05 Nov 2012 10:44:52 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA5AiqMa010099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 5 Nov 2012 05:44:52 -0500 Received: from zalov.redhat.com (vpn1-7-9.ams2.redhat.com [10.36.7.9]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA5AioaW017543 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 5 Nov 2012 05:44:52 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id qA5AioUL025432 for ; Mon, 5 Nov 2012 11:44:50 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id qA5Ainaa025431 for gcc-patches@gcc.gnu.org; Mon, 5 Nov 2012 11:44:49 +0100 Date: Mon, 5 Nov 2012 11:44:49 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix up pr19105.c test regexp for ppc (PR testsuite/55188) Message-ID: <20121105104449.GH1881@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! Depending on branch cost, e.g. on ppc v != d && v != e isn't folded in the FE. On x86_64/i686 we have in *.original for range1: return (x != 0 && (unsigned int) v != 2) && (unsigned int) v + 4294967293 > 1; but on ppc return ((x != 0 && (unsigned int) v != 2) && (unsigned int) v != 3) && (unsigned int) v != 4; The inter-bb range test optimization optimizes both the same, into x != 0 && (unsigned int) v + 4294967294 > 2 equivalent (gimplified of course), but it prints different message that the test was trying to match to see if the optimization happened. The following patch adjusts the regexp. Unfortunately I couldn't find a way to insert there ERE () to make the regexp shorter (wanted to have there .. and -.3, (3. and -.4, )?4. or and -.3, (3. and -.4, |)4. but neither worked, not with zero, one, two or three backslashes before ( and ). So I've ended up duplicating the whole regexp with just | in between which seems to work. Tested on x86_64-linux (-m32/-m64) and powerpc64-linux cross (-m32/-m64), ok for trunk? 2012-11-05 Jakub Jelinek PR testsuite/55188 * gcc.dg/pr19105.c: Accept also optimizing -[2, 2] and -[3, 3] and -[4, 4] range tests together. Jakub --- gcc/testsuite/gcc.dg/pr19105.c.jj 2012-10-31 09:44:44.000000000 +0100 +++ gcc/testsuite/gcc.dg/pr19105.c 2012-11-05 11:29:33.921707151 +0100 @@ -17,6 +17,6 @@ int range2 (enum e v, int x) return x && (v != c && v != d && v != e); } -/* { dg-final { scan-tree-dump-times "Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 4.\[\n\r\]* into" 1 "reassoc1" } } */ +/* { dg-final { scan-tree-dump-times "Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 4.\[\n\r\]* into|Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 1 "reassoc1" } } */ /* { dg-final { cleanup-tree-dump "reassoc1" } } */