From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 45444 invoked by alias); 28 Nov 2017 10:24:55 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 45425 invoked by uid 89); 28 Nov 2017 10:24:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.2 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_NUMSUBJECT,KAM_SHORT,KB_WAM_FROM_NAME_SINGLEWORD,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Nov 2017 10:24:52 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C14A13680C; Tue, 28 Nov 2017 10:24:51 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-77.ams2.redhat.com [10.36.116.77]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6AF6560602; Tue, 28 Nov 2017 10:24:51 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id vASAOmrp032502; Tue, 28 Nov 2017 11:24:48 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id vASAOkWj032501; Tue, 28 Nov 2017 11:24:46 +0100 Date: Tue, 28 Nov 2017 10:56:00 -0000 From: Jakub Jelinek To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org Subject: [committed] Add testcase for PR rtl-optimization/81020 Message-ID: <20171128102446.GB2320@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02388.txt.bz2 Hi! This testcase was fixed by Segher's r254875: https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00340.html on the trunk, so I've committed it to trunk as obvious. On release branches it still needs fixing. 2017-11-28 Jakub Jelinek PR rtl-optimization/81020 * gcc.dg/pr81020.c: New test. --- gcc/testsuite/gcc.dg/pr81020.c.jj 2017-11-27 18:49:06.659907687 +0100 +++ gcc/testsuite/gcc.dg/pr81020.c 2017-11-27 18:49:00.431982443 +0100 @@ -0,0 +1,23 @@ +/* PR rtl-optimization/81020 */ +/* { dg-do run } */ +/* { dg-options "-O -fno-tree-bit-ccp -fno-tree-coalesce-vars -fno-tree-vrp" } */ + +unsigned v = 4; + +unsigned long long __attribute__((noipa)) +foo (unsigned x) +{ + unsigned a = v; + a &= 1; + x |= 0 < a; + a >>= 31; + return x + a; +} + +int +main () +{ + if (foo (2) != 2) + __builtin_abort (); + return 0; +} Jakub