From patchwork Tue Jul 16 14:59:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 1132823 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-505155-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="BenCsByq"; 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 45p3TF1qnqz9s4Y for ; Wed, 17 Jul 2019 00:59:27 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=bDP9v3PQ4Gf3tjqefbIur+g7wrudfR2Z7Bo5UwdM7muZoKMsfW JggZieGA4XmuPaCgDXunetcjDxdfNPJZaInGj/XAKBBmGfIJ6FZGx468Pde16jCi 2cxcJk5nBCdo2hgzv/LHHRsvZOeptl+FXzu0t6arPBZ/EOx/Ct1eivR7s= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=jivJfSYVohyiIcEvuJFb85QcTJ8=; b=BenCsByqwpyzWB9/5cxt GGtvH7lcY6S56DA/OyNk6ATFffuCT7KAccxHLtYiy6iSsMd0N6nefCGwIABnYsww 906mZKm2qGe72S7XPUjAwvjrC2/sTtSqw2mSYzgZxW0QQtqamUwkUx+50qTWxThN DKX0/EXa5lcALgCAef7Zpr8= Received: (qmail 97599 invoked by alias); 16 Jul 2019 14:59: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 97591 invoked by uid 89); 16 Jul 2019 14:59:19 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.1 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, 16 Jul 2019 14:59:18 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4E5A307CDEA for ; Tue, 16 Jul 2019 14:59:17 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-34.rdu2.redhat.com [10.10.112.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16FFC600C4 for ; Tue, 16 Jul 2019 14:59:16 +0000 (UTC) To: gcc-patches@gcc.gnu.org From: Jeff Law Subject: [committed] pr91173 testcase Openpgp: preference=signencrypt Message-ID: <082fbb87-19f2-90e7-85ea-e8942d9b0074@redhat.com> Date: Tue, 16 Jul 2019 08:59:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 X-IsSubscribed: yes Opps, forgot the testcase... Jeff commit 6a8750b4ecafeac5411075730e9f8fa7a1e8238a Author: law Date: Tue Jul 16 14:57:51 2019 +0000 PR rtl-optimization/91173 * g++.dg/pr91173.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@273531 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index fc0b1298148..23d8c776321 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-07-16 Jeff Law + + PR rtl-optimization/91173 + * g++.dg/pr91173.C: New test. + 2019-07-16 Wilco Dijkstra PR target/89190 diff --git a/gcc/testsuite/g++.dg/pr91173.C b/gcc/testsuite/g++.dg/pr91173.C new file mode 100644 index 00000000000..b8fb41ba0cd --- /dev/null +++ b/gcc/testsuite/g++.dg/pr91173.C @@ -0,0 +1,45 @@ +class a { + int b; + void *c; + +public: + bool aa(); + int &ab() { + if (aa()) { + void *d(c); + return static_cast(d)[b]; + } + return *(int *)0; + } +}; +typedef enum {E} e; +class f : public a { + int g; + +public: + int ac() { + if (g) + return 1; + return ac(); + } +}; +int *ad; +struct h { + static int ae(e, int *m) { + f ag; + int *ah; + while (!0) { + ad = &ag.ab(); + ah = ad + ag.ac(); + while (ad < ah) + *m = *ad++; + } + } +}; +template +void i(int *, int *, int, int *, e n, int *o) { + h::ae(n, o); +} +int aq, ar, as, at, au; +void aw() { i(&aq, &ar, as, &at, (e)0, &au); } +