From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id C7FD039730FD for ; Wed, 14 Jul 2021 11:29:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7FD039730FD Received: by mail-ej1-x62a.google.com with SMTP id hc15so2792911ejc.4 for ; Wed, 14 Jul 2021 04:29:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=abZnkzAx5Zu1q+zM8h3Cz9K3IOKntYdNQRQOfZ+R8Ak=; b=bEAOa4HrPx3YY7cTprLUjkQK7pd4a4ZdSXaeNOZo5+o6OhbmKpWZyFDCOeKrqSexlL wYoMsYv205DWpdCT3oWeBiaJrTSIndBZTq6l+jJevIqMpEm4utGZ9gHXtT39w8AZ/LUh aLwsn2jW1JIDdIAO6UFN1yKghiCD7mguRjNUF9AQ0vL0ZmjRE8xEOHj1Wadg6yPk7zmN a0woP5i1YmGAW3S7Yh5/rNwOZCF4rwec0vUmXvv0d1gZa0Za8Vn05IokWF+TTjYpNhSJ dq5lP2cr7Wri+OqdXyWVwWMy5bcs4r37OcamCWVYRyThhl+w/ncOcrnQl8vB/r2io6c2 MHEw== X-Gm-Message-State: AOAM5339O1rqgQJrXP7WjbpATZuQ8ByCFdPrTE0D5yj7P5jjBI1RfNyB JwWH4TfPxm6L46XuWJOYXph0gP7SkWgHqQ2I6CM= X-Google-Smtp-Source: ABdhPJwxUM6S3Z9lanEu0/KskOdbgy2sYwV+FR/x6imK1+EKO2HHodgdoZrOI0XVwXpMJJ8s9U7zLCa6vs5+BdRmH2s= X-Received: by 2002:a17:906:16cd:: with SMTP id t13mr12006058ejd.250.1626262174878; Wed, 14 Jul 2021 04:29:34 -0700 (PDT) MIME-Version: 1.0 References: <20210714081827.12185-1-tbsaunde@tbsaunde.org> <20210714081827.12185-3-tbsaunde@tbsaunde.org> In-Reply-To: <20210714081827.12185-3-tbsaunde@tbsaunde.org> From: Richard Biener Date: Wed, 14 Jul 2021 13:29:23 +0200 Message-ID: Subject: Re: [PATCH 3/4] use diagnostic location in diagnostic_report_current_function To: Trevor Saunders Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jul 2021 11:29:37 -0000 On Wed, Jul 14, 2021 at 10:21 AM Trevor Saunders wrote: > > It appears that input_location was used here before the diagnostic's location > was available, and never updated, when the other part of the header was added > that uses it, so this makes it consistent. > > bootstrapped and regtested on x86_64-linux-gnu, ok? OK. Thanks, Richard. > Trev > > gcc/ChangeLog: > > * tree-diagnostic.c (diagnostic_report_current_function): Use the > diagnostic's location, not input_location. > --- > gcc/tree-diagnostic.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/gcc/tree-diagnostic.c b/gcc/tree-diagnostic.c > index 8bb214b2cf5..705da94637d 100644 > --- a/gcc/tree-diagnostic.c > +++ b/gcc/tree-diagnostic.c > @@ -36,9 +36,9 @@ void > diagnostic_report_current_function (diagnostic_context *context, > diagnostic_info *diagnostic) > { > - diagnostic_report_current_module (context, diagnostic_location (diagnostic)); > - lang_hooks.print_error_function (context, LOCATION_FILE (input_location), > - diagnostic); > + location_t loc = diagnostic_location (diagnostic); > + diagnostic_report_current_module (context, loc); > + lang_hooks.print_error_function (context, LOCATION_FILE (loc), diagnostic); > } > > static void > -- > 2.20.1 >