From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7400 invoked by alias); 4 Dec 2015 18:13:38 -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 7391 invoked by uid 89); 4 Dec 2015 18:13:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 04 Dec 2015 18:13:37 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A087619CB9C; Fri, 4 Dec 2015 18:13:35 +0000 (UTC) Received: from [10.3.235.92] (vpn-235-92.phx2.redhat.com [10.3.235.92]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB4IDYJX012376; Fri, 4 Dec 2015 13:13:34 -0500 Message-ID: <1449252814.8490.39.camel@surprise> Subject: Re: [PATCH 01/10] C++ FE: expression ranges v4 From: David Malcolm To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, Manuel =?ISO-8859-1?Q?L=F3pez-Ib=E1=F1ez?= Date: Fri, 04 Dec 2015 18:13:00 -0000 In-Reply-To: <5661C906.2040807@redhat.com> References: <565627A0.6040107@redhat.com> <1449154548-43964-1-git-send-email-dmalcolm@redhat.com> <1449154548-43964-2-git-send-email-dmalcolm@redhat.com> <5661C906.2040807@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00614.txt.bz2 On Fri, 2015-12-04 at 12:10 -0500, Jason Merrill wrote: > On 12/03/2015 09:55 AM, David Malcolm wrote: > > @@ -362,10 +362,11 @@ convert_to_real_1 (tree type, tree expr, bool fold_p) > > case REAL_TYPE: > > /* Ignore the conversion if we don't need to store intermediate > > results and neither type is a decimal float. */ > > - return build1 ((flag_float_store > > - || DECIMAL_FLOAT_TYPE_P (type) > > - || DECIMAL_FLOAT_TYPE_P (itype)) > > - ? CONVERT_EXPR : NOP_EXPR, type, expr); > > + return build1_loc (loc, > > + (flag_float_store > > + || DECIMAL_FLOAT_TYPE_P (type) > > + || DECIMAL_FLOAT_TYPE_P (itype)) > > + ? CONVERT_EXPR : NOP_EXPR, type, expr); > .... > > @@ -5438,7 +5438,7 @@ build_nop (tree type, tree expr) > > { > > if (type == error_mark_node || error_operand_p (expr)) > > return expr; > > - return build1 (NOP_EXPR, type, expr); > > + return build1_loc (EXPR_LOCATION (expr), NOP_EXPR, type, expr); > > Hmm, I'm uneasy about assigning a location to a conversion or other > expression that doesn't correspond to particular text; it could be > associated with the location of the operand or the enclosing expression > that prompted the conversion. I think we've been deliberately leaving > the location unset. But that causes problems with code that only looks > at the top-level EXPR_LOCATION. Arguably such code should be fixed to > look at the pre-conversion expression tree for a location, but I guess > this is reasonable. > Past GCC 6 I think we definitely want to use a new tree code rather than > cp_expr; as Jakub pointed out, cp_expr doesn't do anything for templates > or language-independent code. > > The current patchset is OK for GCC 6. Thanks. I've committed it to trunk as r231293.