From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92322 invoked by alias); 20 Dec 2018 16:00:40 -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 87637 invoked by uid 89); 20 Dec 2018 16:00:27 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=Hx-languages-length:1307, HX-Gm-Message-State:aEWb, HX-Received:aed, job X-HELO: mail-qt1-f195.google.com Received: from mail-qt1-f195.google.com (HELO mail-qt1-f195.google.com) (209.85.160.195) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Dec 2018 16:00:22 +0000 Received: by mail-qt1-f195.google.com with SMTP id e5so2297875qtr.12 for ; Thu, 20 Dec 2018 08:00:14 -0800 (PST) Return-Path: Received: from [192.168.1.149] (209-6-216-142.s141.c3-0.smr-cbr1.sbo-smr.ma.cable.rcncustomer.com. [209.6.216.142]) by smtp.gmail.com with ESMTPSA id f13sm3083717qkm.52.2018.12.20.08.00.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 20 Dec 2018 08:00:11 -0800 (PST) Subject: Re: [C++ PATCH] Constexpr fold even some TREE_CONSTANT ctors (PR c++/87934) To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: <20181218204517.GS23305@tucnak> <20181218231937.GW23305@tucnak> <89ec010c-1b82-47ff-fd46-7f87d20b53e9@redhat.com> <20181219231410.GK23305@tucnak> From: Jason Merrill Message-ID: Date: Thu, 20 Dec 2018 16:01:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: <20181219231410.GK23305@tucnak> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01473.txt.bz2 On 12/19/18 6:14 PM, Jakub Jelinek wrote: > On Tue, Dec 18, 2018 at 10:27:56PM -0500, Jason Merrill wrote: >> On 12/18/18 6:19 PM, Jakub Jelinek wrote: >>> On Tue, Dec 18, 2018 at 05:40:03PM -0500, Jason Merrill wrote: >>>> On 12/18/18 3:45 PM, Jakub Jelinek wrote: >>>>> The following testcase FAILs, because parsing creates a TREE_CONSTANT >>>>> CONSTRUCTOR that contains CONST_DECL elts. cp_fold_r can handle that, >>>>> but constexpr evaluation doesn't touch those CONSTRUCTORs. >>>>> >>>>> Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for >>>>> trunk? >>>> >>>> OK. I also wonder if store_init_value should use cp_fold_r rather than just >>>> cp_fully_fold. >>> >>> I've been thinking about that already when working on the PR88410 bug. >>> >>> Do you mean something like following completely untested patch? >>> Perhaps I could add a helper inline so that there is no code repetition >>> between cp_fully_fold and this new function. >> >> Something like that, yes. > > The following does the job too (even the PR88410 ICE is gone with the > cp-gimplify.c change from that patch reverted) and is shorter. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK, thanks. Jason