From patchwork Tue Aug 12 02:51:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 35222 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 948FA20AEC for ; Tue, 12 Aug 2014 02:51:50 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id et14sf67059600pad.2 for ; Mon, 11 Aug 2014 19:51:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-original-sender :x-original-authentication-results:content-type; bh=5c3apvq+SDQ0vRZ9pDCzh3iBlEfPC1g5Xd7rgWqlms8=; b=JXOrlDCS0Vqs3D8c4QjS8G0mn+k74ege9W6ceDAzoXlC03q6GrtOOu3dZcqwfBZbJz 4KZ9tRIa2Y6jnr3PszxtocHm4jZoQlz3nauOwfJ2dYewhR514YAhrJHzBb3b9IBtqqM4 ygEmztv85wEh7FMUb0Bx13+Abng2MzTWryMpgEsVdrUNHZiKHthlWxhoYedF/UU+P9Dp uVkxAFoSufnWS+7gRcUZEW5ZfCKluIRUceODS+laSyO4FQg+TKLSUnW+k7mQFg7Kya9c NKIWf2WSqkbZSpv1D1JjrwZICZQaoAeyrBygWwqmLaPWlluTT7EZ2Rbogasdr8pAoKVk BvfQ== X-Gm-Message-State: ALoCoQlUYQV9xjZFF/YV87Cv/2u1+wEASbxHoWhtmOW4ItuPpJPNC9eJ+d+DLwWe4mAn5GGCgD+P X-Received: by 10.66.147.227 with SMTP id tn3mr1143557pab.4.1407811909674; Mon, 11 Aug 2014 19:51:49 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.210 with SMTP id u76ls1090098qge.62.gmail; Mon, 11 Aug 2014 19:51:49 -0700 (PDT) X-Received: by 10.52.146.17 with SMTP id sy17mr21548842vdb.29.1407811909548; Mon, 11 Aug 2014 19:51:49 -0700 (PDT) Received: from mail-vc0-x235.google.com (mail-vc0-x235.google.com [2607:f8b0:400c:c03::235]) by mx.google.com with ESMTPS id t9si5442652vco.90.2014.08.11.19.51.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 11 Aug 2014 19:51:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::235 as permitted sender) client-ip=2607:f8b0:400c:c03::235; Received: by mail-vc0-f181.google.com with SMTP id lf12so12453374vcb.26 for ; Mon, 11 Aug 2014 19:51:49 -0700 (PDT) X-Received: by 10.52.97.233 with SMTP id ed9mr21468108vdb.16.1407811909390; Mon, 11 Aug 2014 19:51:49 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp212585vcb; Mon, 11 Aug 2014 19:51:47 -0700 (PDT) X-Received: by 10.68.197.65 with SMTP id is1mr1644459pbc.125.1407811907147; Mon, 11 Aug 2014 19:51:47 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id y5si13997999pas.16.2014.08.11.19.51.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Aug 2014 19:51:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-374867-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 27496 invoked by alias); 12 Aug 2014 02:51:33 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 27476 invoked by uid 89); 12 Aug 2014 02:51:29 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pd0-f170.google.com Received: from mail-pd0-f170.google.com (HELO mail-pd0-f170.google.com) (209.85.192.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 12 Aug 2014 02:51:28 +0000 Received: by mail-pd0-f170.google.com with SMTP id g10so11866805pdj.1 for ; Mon, 11 Aug 2014 19:51:26 -0700 (PDT) X-Received: by 10.66.173.144 with SMTP id bk16mr1660326pac.34.1407811886603; Mon, 11 Aug 2014 19:51:26 -0700 (PDT) Received: from [10.1.1.8] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id da14sm7874248pac.24.2014.08.11.19.51.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Aug 2014 19:51:25 -0700 (PDT) Message-ID: <53E98117.9090904@linaro.org> Date: Tue, 12 Aug 2014 12:51:03 +1000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Richard Biener CC: "gcc-patches@gcc.gnu.org" Subject: Re: PR tree-optimization/52904 testcase References: <53E6151A.203@linaro.org> In-Reply-To: X-IsSubscribed: yes X-Original-Sender: kugan.vivekanandarajah@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c03::235 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 On 11/08/14 18:03, Richard Biener wrote: > On Sat, Aug 9, 2014 at 2:33 PM, Kugan wrote: >> Hi, >> >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52904 >> >> Tescase was generating warning: assuming signed overflow does not occur >> when simplifying conditional to constant [-Wstrict-overflow] due to VRP >> missing the value range. >> >> This seems to have been fixed and the PR is now closed. However, as >> requested there in the PR, I am sending this patch to add the test-case >> to test-suite. >> >> >> Is this OK ? > > Did you verify the testcase fails before the revision that fixed it? > Esp. the placement of the dg-bogus looks bogus to me. I tried it on Linaro 4.9 (It should be the same in fsf gcc 4.9 branch) and the test cases is failing there. Passes on trunk. In any case, I have moved it to the top and reverified. I have also trimmed the warning pattern to check as there was some changes there from 4.9 to trunk. > > Also don't use -S in dg-options, use lower-case filenames and > avoid spurious vertical white-space. The VRP dump scan is > also very unspecific - I suggest to drop it entirely. > Done. Is this OK? Thanks, Kugan gcc/testsuite 2014-08-12 Kugan Vivekanandarajah PR tree-optimization/52904 * gcc.dg/pr52904.c: New test. > Thanks, > Richard. > >> Thanks, >> Kugan >> >> gcc/testsuite >> >> >> 2014-08-09 Kugan Vivekanandarajah >> >> PR tree-optimization/52904 >> * gcc.dg/PR52904.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr52904.c b/gcc/testsuite/gcc.dg/pr52904.c index e69de29..7c04187 100644 --- a/gcc/testsuite/gcc.dg/pr52904.c +++ b/gcc/testsuite/gcc.dg/pr52904.c @@ -0,0 +1,24 @@ + +/* { dg-do compile } */ +/* { dg-options "-Wstrict-overflow -O2" } */ +/* { dg-bogus "assuming signed overflow does not occur when simplifying" */ + +extern int foo (int); + +int +wait_reading_process_output (void) +{ + int nfds = 0; + int channel; + for (channel = 0; channel < 1024; ++channel) + { + if (foo (channel)) + nfds++; + } + + if (nfds < 0) + return 1; + + return 0; +} +