From patchwork Tue Dec 5 13:36:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 844742 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-468518-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="oAh2tsIL"; 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 3yrjT40XD6z9tB8 for ; Wed, 6 Dec 2017 00:36:39 +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 :from:to:subject:message-id:reply-to:mime-version:content-type; q=dns; s=default; b=O34AXdDqx3MExZ8V/QxKnnuHKpVMnORD6E9tsA8sBxO 8mXDGM66IODrWue/tL4BCKZ56YZdHNWnVwrb6mJUBCeyAhWqoHlWuxWC+uWCGt7h thudvfftG9dzfEcEDxY1Bh5EW8zpdFjcfALICLVy7jeBuXmHnudW/9zwwmYaioUA = 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 :from:to:subject:message-id:reply-to:mime-version:content-type; s=default; bh=dwUWU1S7muJC8EFBrkR700Yri30=; b=oAh2tsILNXhtPnttO 8zRngkFVzrd/TnitArjNCnkaqTXgUtePVGjqb1NpqvM9wrOa3ZtF882iolw4Jzzv q2jOW2x37zf5tTkKuDYUWAwDsdEf/3QHmiR3dVTWCMRq8XbJBpM3zSzieBYFVIVV /hcdIF7NYzEXPu07/uqlmIYXvM= Received: (qmail 4354 invoked by alias); 5 Dec 2017 13:36:32 -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 4343 invoked by uid 89); 5 Dec 2017 13:36:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, 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, 05 Dec 2017 13:36:27 +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 3772A806A4 for ; Tue, 5 Dec 2017 13:36:26 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-116-34.ams2.redhat.com [10.36.116.34]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D27C660605 for ; Tue, 5 Dec 2017 13:36:25 +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 vB5DaNpj022124 for ; Tue, 5 Dec 2017 14:36:23 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id vB5DaMmE022123 for gcc-patches@gcc.gnu.org; Tue, 5 Dec 2017 14:36:22 +0100 Date: Tue, 5 Dec 2017 14:36:22 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Add testcase for already fixed PR (PR tree-optimization/83283) Message-ID: <20171205133622.GV2353@tucnak> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) X-IsSubscribed: yes Hi! This testcase has been fixed by r253146 but that testcase is quite different from this one, so I've committed this to trunk as obvious. 2017-12-05 Jakub Jelinek PR tree-optimization/83283 * g++.dg/torture/pr83283.C: New test. Jakub --- gcc/testsuite/g++.dg/torture/pr83283.C.jj 2017-12-05 13:01:03.432144366 +0100 +++ gcc/testsuite/g++.dg/torture/pr83283.C 2017-12-05 13:00:55.926238921 +0100 @@ -0,0 +1,26 @@ +// PR tree-optimization/83283 +// { dg-do run } +// { dg-additional-options "-std=c++11" } + +enum E : unsigned char { X = 0, Y = 1 }; + +void __attribute__((noinline)) +foo (E *v, int size) +{ + for (int i = 0; i < size; ++i) + { + const bool b = (v[i] == E::Y); + v[i] = static_cast(static_cast(b)); + } +} + +int +main () +{ + constexpr int items = 32; + E vals[items] = {X}; + vals[3] = Y; + foo (vals, items); + if (vals[3] != 1) + __builtin_abort (); +}