From patchwork Thu May 4 07:43:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 89939 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp124287vqo; Thu, 4 May 2023 00:43:59 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7YS8tdWBGPP1Jn5xgMwBBroopM0HEGnIyyJO63FI7S3HTiQdKpI2ZKMowvghkFLg2C+pyl X-Received: by 2002:aa7:ccc9:0:b0:50b:cbcf:7d9a with SMTP id y9-20020aa7ccc9000000b0050bcbcf7d9amr716313edt.20.1683186238902; Thu, 04 May 2023 00:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683186238; cv=none; d=google.com; s=arc-20160816; b=oEx3UBn0RTYLRAX9bxpQCCQ2PrdztLpXgPHoxYjsXEnGxY2sK9JSxdm8GzshE2/2Ri MXBZXNUerlU5rPQueKlb58Nd9Q9whE/eLtSPhj5bJ2RUY52i6w4Owdp0e5kggUypufc0 uSiy4Qu/ke7UeUSxgouNQZoigfXB16p+m6j7Gc2THwAvEq6K0zGmHgOsp18oC8hixZy9 E3KvpxHhoM1dHp/XWZI73iJAdR1MTmRPYWkEHQOqOE9diMSXI7Zf5FXApPiBoxPs4+it z3haoyFmOQ5MSshcd5pKmIlkbjIh+IcH7jL2FUzDTGzR4AYNhnKNu/3wxSeTpgd5x52m WldA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=sTUB9qnCjnWHkOg/sMjWTzKbWpkuMo2sZYQ82t+OKSw=; b=p3a8vwHKlVy+MdpXoaJ4vZYYvWUl7+NK8U1gaWeLoAzrd/OmeHxyQCscyeG9GIMcE/ 6+6UB9gCPhaim61tNfaWtfAPPhlnLoMm0blsPP3jO/SunszTFsOyrMq/02Z9RlVB6n73 iS4/aMHDTdKuGgKS0I/NYJA6xCVzmoQ7vA1PyOAE5yW4Jcjsipym511MYK5vpeolrzmP fy6UE/quCB1rVl316fTodLZjrNR0uQ/OfkTkNHZl8mILSWrb3iOSfDd/knHbQn+wL/2q vWSOs0u5zWT8ju5aKOBi+m8vY4o5pygYwf33MYlJzHcinlhJagNbYYo+DUm46FH5yBSi rbcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mFopX2+Y; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id w26-20020aa7cb5a000000b0050bff39a85dsi1050503edt.577.2023.05.04.00.43.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 00:43:58 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=mFopX2+Y; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BF703857005 for ; Thu, 4 May 2023 07:43:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BF703857005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683186237; bh=sTUB9qnCjnWHkOg/sMjWTzKbWpkuMo2sZYQ82t+OKSw=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=mFopX2+Y/s5cKxnVOeA+Sfvt21pD+hZYBC+i3BfTEEQpTeO076Z0tDI5oM9WWER60 EX2cQlqinoJzJbWzlZs9llhYWXp2/QIL13VWABhPOGEw8x8eyL0qeosjiBYBtaPuKF +9BQGsk5XeTROyIBwMMtsguHXiR6KxoEouARZ7dI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id BDBB43858D28 for ; Thu, 4 May 2023 07:43:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDBB43858D28 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id EDDF720951 for ; Thu, 4 May 2023 07:43:13 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DB9E0133F7 for ; Thu, 4 May 2023 07:43:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ynGPNBFiU2TlGgAAMHmgww (envelope-from ) for ; Thu, 04 May 2023 07:43:13 +0000 Date: Thu, 4 May 2023 09:43:13 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/109724 - new testcase MIME-Version: 1.0 Message-Id: <20230504074313.DB9E0133F7@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764948693226949256?= X-GMAIL-MSGID: =?utf-8?q?1764948693226949256?= The following adds a testcase for PR109724 which was caused by backporting r13-2375-gbe1b42de9c151d and fixed by r11-199-g2b42509f8b7bdf. Tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/109724 * g++.dg/torture/pr109724.C: New testcase. --- gcc/testsuite/g++.dg/torture/pr109724.C | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 gcc/testsuite/g++.dg/torture/pr109724.C diff --git a/gcc/testsuite/g++.dg/torture/pr109724.C b/gcc/testsuite/g++.dg/torture/pr109724.C new file mode 100644 index 00000000000..4a88e1519d0 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr109724.C @@ -0,0 +1,32 @@ +// { dg-do compile } + +double &SkTMax(double &a, double &b) { return a ?: b; } +struct SkDPoint { + double fX; +}; +struct SkDCubic { + SkDPoint &operator[](int n) { return fPts[n]; } + SkDPoint fPts[4]; +}; +struct SkDCurve { + SkDCubic fCubic; + SkDPoint &operator[](int n) { return fCubic[n]; } +}; +struct SkDCurveSweep { + SkDCurve fCurve; +}; +int endsIntersect_rPts; +double endsIntersect_maxX; +struct SkOpAngle { + void endsIntersect(); + SkDCurveSweep fPart; +} endsIntersect_rh; +void SkOpAngle::endsIntersect() { + for (int index = 0;; ++index) { + SkDCurve &curve = index ? endsIntersect_rh.fPart.fCurve : fPart.fCurve; + for (int idx2 = 0; endsIntersect_rPts; ++idx2) { + SkDPoint &__trans_tmp_1 = curve[idx2]; + endsIntersect_maxX = SkTMax(endsIntersect_maxX, __trans_tmp_1.fX); + } + } +}