From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10702 invoked by alias); 3 Aug 2015 09:42:39 -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 10692 invoked by uid 89); 3 Aug 2015 09:42:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f173.google.com Received: from mail-wi0-f173.google.com (HELO mail-wi0-f173.google.com) (209.85.212.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 03 Aug 2015 09:42:37 +0000 Received: by wibud3 with SMTP id ud3so105895916wib.0 for ; Mon, 03 Aug 2015 02:42:34 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.180.73.237 with SMTP id o13mr33710094wiv.55.1438594954408; Mon, 03 Aug 2015 02:42:34 -0700 (PDT) Received: by 10.27.219.74 with HTTP; Mon, 3 Aug 2015 02:42:34 -0700 (PDT) In-Reply-To: <55BEE4CE.9070706@redhat.com> References: <557A5214.7060106@redhat.com> <55B911DD.30105@redhat.com> <55BA5667.9040200@redhat.com> <55BAACF9.7040707@redhat.com> <597173047.4338388.1438379666336.JavaMail.zimbra@redhat.com> <55BEE4CE.9070706@redhat.com> Date: Mon, 03 Aug 2015 09:42:00 -0000 Message-ID: Subject: Re: C++ delayed folding branch review From: Kai Tietz To: Jason Merrill Cc: Kai Tietz , gcc-patches List Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00035.txt.bz2 2015-08-03 5:49 GMT+02:00 Jason Merrill : > On 07/31/2015 05:54 PM, Kai Tietz wrote: >> >> The "STRIP_NOPS-requirement in 'reduced_constant_expression_p'" I could >> remove, but for one case in constexpr. Without folding we don't do >> type-sinking/raising. > > > Right. > >> So binary/unary operations might be containing cast, which were in the >> past unexpected. > > > Why aren't the casts folded away? On such cast constructs, as for this vector-sample, we can't fold away the cast chain. The difference here to none-delayed-folding branch is that the cast isn't moved out of the plus-expr. What we see now is (plus ((vec) (const vector ...) { .... }), ...). Before we had (vec) (plus (const vector ...) { ... }). >> On verify_constant we check by reduced_constant_expression_p, if value is >> a constant. We don't handle here, that NOP_EXPRs are something we want to >> look through here, as it doesn't change anything if this is a constant, or >> not. > > > NOPs around constants should have been folded away by the time we get there. Not in this cases, as the we actually have here a switch from const to none-const. So there is an attribute-change, which we can't ignore in general. But I agree that for constexpr's we could special case cast from const to none-const (as required in expressions like const vec v = v + 1). > Jason > Kai