From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116458 invoked by alias); 8 Apr 2016 07:12:17 -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 116449 invoked by uid 89); 8 Apr 2016 07:12:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,KAM_MXURI,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= X-HELO: mail.ud10.udmedia.de Received: from ud10.udmedia.de (HELO mail.ud10.udmedia.de) (194.117.254.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 08 Apr 2016 07:12:06 +0000 Received: (qmail 22900 invoked from network); 8 Apr 2016 09:12:01 +0200 Received: from ip5b41f88a.dynamic.kabel-deutschland.de (HELO x4) (ud10?360p3@91.65.248.138) by mail.ud10.udmedia.de with ESMTPSA (ECDHE-RSA-AES256-SHA encrypted, authenticated); 8 Apr 2016 09:12:01 +0200 Date: Fri, 08 Apr 2016 07:12:00 -0000 From: Markus Trippelsdorf To: Patrick Palka Cc: Richard Biener , GCC Patches , Jason Merrill Subject: Re: [PATCH] Avoid needless unsharing during constexpr evaluation (PR c++/70452) Message-ID: <20160408071201.GA310@x4> References: <1459961500-8709-1-git-send-email-patrick@parcs.ath.cx> <23BF17BD-8114-4EAF-9D97-43718D6BB900@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SW-Source: 2016-04/txt/msg00374.txt.bz2 On 2016.04.06 at 18:25 -0400, Patrick Palka wrote: > On Wed, 6 Apr 2016, Patrick Palka wrote: > Here is a safer and simpler approach that just walks the expression > being unshared to try to find a CONSTRUCTOR node. If it finds one, then > we unshare the whole expression. Otherwise we return the original > expression. It should be completely safe to avoid unsharing an > expression if it contains no CONSTRUCTOR nodes. > > gcc/cp/ChangeLog: > > PR c++/70452 > * constexpr.c (find_constructor): New function. > (unshare_constructor): New function. > (cxx_eval_call_expression): Use unshare_constructor instead of > unshare_expr. > (find_array_ctor_elt): Likewise. > (cxx_eval_vec_init_1): Likewise. > (cxx_eval_store_expression): Likewise. > (cxx_eval_constant_expression): Likewise. This patch causes: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70590 -- Markus