From patchwork Fri Sep 4 21:05:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1357846 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=NnPTOToo; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BjqwD5FC9z9sTH for ; Sat, 5 Sep 2020 07:06:03 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DAE9E385701F; Fri, 4 Sep 2020 21:05:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAE9E385701F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1599253559; bh=hj/aoTHU1Xu6axsMdii/5AP9WK9XJKCMwrFkH2m4kq0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=NnPTOTookpuz8aXYB5sTvyX0KkiHEPPsKOHMpFZaGQt1BBfves6McpZlchsndcJ5G Oy9a9Ctwkdhf7avuXOGTzHeBVE/Ymneczvn/0Bl2xoNjX+yd78H/cv5hkowaKTtpr6 UVaVvTecs8qoLTS45+0jBQONOjoCKbmWlouNObo4= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [IPv6:2001:67c:2050::465:102]) by sourceware.org (Postfix) with ESMTPS id 801023857809 for ; Fri, 4 Sep 2020 21:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 801023857809 Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4Bjqw257VLzKmKw; Fri, 4 Sep 2020 23:05:54 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter02.heinlein-hosting.de (spamfilter02.heinlein-hosting.de [80.241.56.116]) (amavisd-new, port 10030) with ESMTP id pVWJB1VVSEIH; Fri, 4 Sep 2020 23:05:51 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Fix ICE in create_tmp_var, at gimple-expr.c:482 Date: Fri, 4 Sep 2020 23:05:49 +0200 Message-Id: <20200904210549.576673-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-MBO-SPAM-Probability: **** X-Rspamd-Score: 5.02 / 15.00 / 15.00 X-Rspamd-Queue-Id: 5898B17A1 X-Rspamd-UID: ce56ff X-Spam-Status: No, score=-14.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_ABUSE_SURBL, URIBL_RED autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi, Array concatenate expressions were creating more SAVE_EXPRs than what was necessary. The internal error itself was the result of a forced temporary being made on a TREE_ADDRESSABLE type. Bootstrapped and regression tested on x86_64-linux-gnu/-m32/-mx32. Committed to mainline and backported to the releases/gcc-10 branch. Regards Iain --- gcc/d/ChangeLog: PR d/96924 * expr.cc (ExprVisitor::visit (CatAssignExp *)): Don't force temporaries needlessly. gcc/testsuite/ChangeLog: PR d/96924 * gdc.dg/simd13927b.d: Removed. * gdc.dg/pr96924.d: New test. --- gcc/d/expr.cc | 3 --- gcc/testsuite/gdc.dg/pr96924.d | 14 ++++++++++++++ gcc/testsuite/gdc.dg/simd13927b.d | 12 ------------ 3 files changed, 14 insertions(+), 15 deletions(-) create mode 100644 gcc/testsuite/gdc.dg/pr96924.d delete mode 100644 gcc/testsuite/gdc.dg/simd13927b.d diff --git a/gcc/d/expr.cc b/gcc/d/expr.cc index 2b13615521d..79f212c3a08 100644 --- a/gcc/d/expr.cc +++ b/gcc/d/expr.cc @@ -875,7 +875,6 @@ public: tree offexp = d_array_length (result); offexp = build2 (MINUS_EXPR, TREE_TYPE (offexp), offexp, size_one_node); - offexp = d_save_expr (offexp); tree ptrexp = d_array_ptr (result); ptrexp = void_okay_p (ptrexp); @@ -885,9 +884,7 @@ public: tree t2 = build_expr (e->e2); tree expr = stabilize_expr (&t2); - t2 = d_save_expr (t2); result = modify_expr (build_deref (ptrexp), t2); - result = compound_expr (t2, result); this->result_ = compound_expr (expr, result); } diff --git a/gcc/testsuite/gdc.dg/pr96924.d b/gcc/testsuite/gdc.dg/pr96924.d new file mode 100644 index 00000000000..25d9a566fbe --- /dev/null +++ b/gcc/testsuite/gdc.dg/pr96924.d @@ -0,0 +1,14 @@ +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96924 +// { dg-do compile } + +struct Memo +{ + string source; + this(this); +} + +void compile(string src, size_t end) +{ + Memo[] stack; + stack ~= Memo(src[end .. $]); +} diff --git a/gcc/testsuite/gdc.dg/simd13927b.d b/gcc/testsuite/gdc.dg/simd13927b.d deleted file mode 100644 index fbbaf867cd8..00000000000 --- a/gcc/testsuite/gdc.dg/simd13927b.d +++ /dev/null @@ -1,12 +0,0 @@ -// https://issues.dlang.org/show_bug.cgi?id=13927 -// { dg-additional-options "-mavx" { target avx_runtime } } -// { dg-do compile { target { avx_runtime || vect_sizes_16B_8B } } } -import core.simd; - -alias double8 = __vector(double[8]); - -void test13927(double8 a) -{ - double8 b = [long.min, long.min, long.max, long.max]; - auto tmp = a - b; -}