From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 56297 invoked by alias); 17 Nov 2016 09:00:00 -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 56269 invoked by uid 89); 17 Nov 2016 09:00:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1136 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 17 Nov 2016 08:59:59 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 64013AC0D; Thu, 17 Nov 2016 08:59:57 +0000 (UTC) Date: Thu, 17 Nov 2016 09:00:00 -0000 From: Richard Biener To: Jason Merrill cc: Jakub Jelinek , gcc-patches List Subject: Re: [PATCH] Fix up ICEs with TREE_CONSTANT references (PR c++/78373) In-Reply-To: Message-ID: References: <20161116210027.GB3541@tucnak.redhat.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2016-11/txt/msg01758.txt.bz2 On Wed, 16 Nov 2016, Jason Merrill wrote: > On Wed, Nov 16, 2016 at 4:00 PM, Jakub Jelinek wrote: > > Jason's recent patch to turn reference vars initialized with invariant > > addresses broke the first testcase below, because &self->singleton > > is considered TREE_CONSTANT (because self is TREE_CONSTANT VAR_DECL and > > singleton field has constant offset), but after going into SSA form > > it is not supposed to be TREE_CONSTANT anymore (&self_2->singleton), > > because SSA_NAMEs don't have TREE_CONSTANT set on them. > > > > The following patch fixes it by gimplifying such vars into their > > DECL_INITIAL unless in OpenMP regions, where such folding is deferred > > until omplower pass finishes. > > Hmm, this seems like a workaround; why don't we see the same problem > with constant pointer variables? > > A simpler workaround would be to not set TREE_CONSTANT on references > in the first place, since the constexpr code doesn't need it. What do > you think? If that works then it's certainly my preference at this point. Richard.