From patchwork Thu May 19 14:16:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 54230 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B754D3839C49 for ; Thu, 19 May 2022 14:41:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B754D3839C49 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652971263; bh=d+saw1m4JIBUx68vjVYTMjKwdNxF2dYnvx0PKEG+yH4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=NulCC4XFyasmBTRrmxQSjvQEnGRgwnLwxpCkqwVLcJGNNrIUYERO/wRcNoXqD457B ZqhZyjwm0QP3mIgVO5ymmOmilMseacM9X1mUyEsW6BzIc3kZbPm5DP4o3P6OO2zjUU qikZCP/mHmUxBmaCyhbmnMFZmeLx/ZZUVwBkit94= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 4DE73383D830 for ; Thu, 19 May 2022 14:16:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4DE73383D830 Received: by mail-wm1-x335.google.com with SMTP id v191-20020a1cacc8000000b00397001398c0so5089345wme.5 for ; Thu, 19 May 2022 07:16:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=d+saw1m4JIBUx68vjVYTMjKwdNxF2dYnvx0PKEG+yH4=; b=1SfyA/25Yq5Pr8qG1MmO1qcfMclsJLaCw388NysLNLV+lx3DR+I1MUPSW6LWzr9r2x A1xJ8uOVQyQ8qsiToP6/3tt681IYzELJOeAbwmDB5YTGyzgaStfrgZR/UGDO+68OSS+G /BSMtSiW/JdB+b/mdzr1z2B1avyeS1sNwTr+Qo2Bilk+Bb/PV2Xr+qd9ljyI7KMwsZEC pmO9cdtSX4TydzmBD1/2xNlwoz96nNmHz2m9yXd8NuAQsPWxYl0WS5zQzEtVf+zuZTSN 7q0YI56Djdg0xXTqurSw1hgWw8pb/e5JecdmcdrveZqdknGMBMsh+IHsUfEY/Liu6tzL BGnw== X-Gm-Message-State: AOAM530vgXsTp/e0p5IC/nw4UZLSl0cUeB81JIY9bMArVGOjyWXsU8ej +Y3ewOLElQJoRxfD+47cnVNc8SBhCQQo/A== X-Google-Smtp-Source: ABdhPJzhjbDHvfDvBf3cy4izm2k/SViEjmJ4J9Tz2DQfUwpl+N/oDq5uQVmsoAxx6TDMgWCSljdcwA== X-Received: by 2002:a7b:cc13:0:b0:38e:67e3:db47 with SMTP id f19-20020a7bcc13000000b0038e67e3db47mr4627991wmh.133.1652969787506; Thu, 19 May 2022 07:16:27 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id y19-20020adfc7d3000000b0020c5253d8c2sm5882413wrg.14.2022.05.19.07.16.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 May 2022 07:16:26 -0700 (PDT) Date: Thu, 19 May 2022 14:16:26 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Do not set Current_Error_Node to a node without location Message-ID: <20220519141626.GA3723539@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Pierre-Marie de Rodat via Gcc-patches From: Pierre-Marie de Rodat Reply-To: Pierre-Marie de Rodat Cc: Eric Botcazou Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" The message "No source file position information available" is displayed in the bugbox when Current_Error_Node has no location, which is useless. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * gcc-interface/trans.cc (gnat_to_gnu): Do not set Current_Error_Node to a node without location. diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc --- a/gcc/ada/gcc-interface/trans.cc +++ b/gcc/ada/gcc-interface/trans.cc @@ -6139,7 +6139,8 @@ gnat_to_gnu (Node_Id gnat_node) bool aa_sync; /* Save node number for error message and set location information. */ - Current_Error_Node = gnat_node; + if (Sloc (gnat_node) > No_Location) + Current_Error_Node = gnat_node; Sloc_to_locus (Sloc (gnat_node), &input_location); /* If we are only annotating types and this node is a statement, return