From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62606 invoked by alias); 7 Oct 2015 13:59:15 -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 60446 invoked by uid 89); 7 Oct 2015 13:59:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f174.google.com Received: from mail-yk0-f174.google.com (HELO mail-yk0-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 07 Oct 2015 13:59:11 +0000 Received: by ykdz138 with SMTP id z138so17346357ykd.2 for ; Wed, 07 Oct 2015 06:59:09 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.13.215 with SMTP id 206mr1018188ywn.280.1444226349076; Wed, 07 Oct 2015 06:59:09 -0700 (PDT) Received: by 10.37.93.136 with HTTP; Wed, 7 Oct 2015 06:59:09 -0700 (PDT) In-Reply-To: <20151007110200.GX6184@redhat.com> References: <20151006172959.GT6184@redhat.com> <20151007110200.GX6184@redhat.com> Date: Wed, 07 Oct 2015 13:59:00 -0000 Message-ID: Subject: Re: [C PATCH, committed] Use protected_set_expr_location more From: Richard Biener To: Marek Polacek Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00712.txt.bz2 On Wed, Oct 7, 2015 at 1:02 PM, Marek Polacek wrote: > On Wed, Oct 07, 2015 at 10:14:54AM +0200, Richard Biener wrote: >> > --- gcc/c/c-parser.c >> > +++ gcc/c/c-parser.c >> > @@ -5141,9 +5141,8 @@ c_parser_statement_after_labels (c_parser *parser, vec *chain) >> > (recursively) all of the component statements should already have >> > line numbers assigned. ??? Can we discard no-op statements >> > earlier? */ >> > - if (CAN_HAVE_LOCATION_P (stmt) >> > - && EXPR_LOCATION (stmt) == UNKNOWN_LOCATION) >> > - SET_EXPR_LOCATION (stmt, loc); >> > + if (EXPR_LOCATION (stmt) == UNKNOWN_LOCATION) >> > + protected_set_expr_location (stmt, loc); >> >> This one doesn't look like an improvement though as EXPR_LOCATION tests >> CAN_HAVE_LOCATION_P and returns UNKNOWN_LOCATION if not. > > Yeah, but protected_set_expr_location tests CAN_HAVE_LOCATION_P so we > wouldn't set the location anyway. > > But I can surely revert that bit if you prefer. Well, it's not my call but the original code is clearer if one looks up EXPR_LOCATION. Richard. > Marek