From patchwork Wed May 18 08:43:09 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: 54129 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 59F553858434 for ; Wed, 18 May 2022 08:51:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 59F553858434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1652863915; bh=QDaOmoOl6hVI52fbcShv0J0r3O715SYiC3eTQEri/9w=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ACtWHDV/TYbdn0RAjWyp/VupSXuGXmHYF4BS4Rv9VPvXa1+YUQjymVL4M4zM5Dbk7 Q9OYaeLoANTHCGUbQkS1ofQGhlPT/UnDkkF8ZrjHtINlfoLPotSWxTVWiXbdokrBNY FsftBTiIPaY7dNOf88DyC5g/RGDR5SeemkndfMnA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 911C3385780C for ; Wed, 18 May 2022 08:43:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 911C3385780C Received: by mail-wr1-x433.google.com with SMTP id r30so1605554wra.13 for ; Wed, 18 May 2022 01:43:11 -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=QDaOmoOl6hVI52fbcShv0J0r3O715SYiC3eTQEri/9w=; b=g5t8U7f0FnQs4EmEpekO4reSjFgvM00fRvYLVXGK45wJgUkqlKsfy7svgY0SrZrX4y zkaYLmsRUGsql/guMT1ueF4DPkr31jBH1i+5KGNP1jguepEdkyqc7078ZC8Xv7qSSPXt DJ7bx3bdgM3kxIRV5S8wM+gKfEgNiTRWI9TgYVinN4GPAB/3u8vfmimLM7nPO9eCqmST KSGr9svvzSUWjN39ALUE8m9Yf85Cmb8Jp9mdooOynTREJXUUvjsOYE5G9BVWEny9a4Ck z7Oj0stfyyiWmbo4t9FvZiscJH+vhhGsrvr80AZLEe7l4eFu80xc0dSMdAaSdaqEFXko hwvQ== X-Gm-Message-State: AOAM531pg7u/oJOHaXkqv3m1pEc2hD+H6r0ncoqbf6k1bmihCMu+BSAb 6c6wVWqztC1uV5zkWa2gtn9lIBkqi6oR8A== X-Google-Smtp-Source: ABdhPJzrlyj9KMQo0QyQbNdxKv8ydRJWFmRHa+qysWSleQppJ3ys+s5zvAmPETSZN7mdQSgMCEwrpw== X-Received: by 2002:a5d:680b:0:b0:20d:932:8d55 with SMTP id w11-20020a5d680b000000b0020d09328d55mr11882337wru.389.1652863390329; Wed, 18 May 2022 01:43:10 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id x1-20020a05600c21c100b003942a244ee6sm1057895wmj.43.2022.05.18.01.43.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 01:43:09 -0700 (PDT) Date: Wed, 18 May 2022 08:43:09 +0000 To: gcc-patches@gcc.gnu.org Subject: [Ada] Fix internal error on subprogram instantiation Message-ID: <20220518084309.GA3315259@adacore.com> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-13.2 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 compiler builds renamings for actuals of formal objects for debugging purposes in this case, but it must not generate them for temporaries. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * exp_dbug.ads (Build_Subprogram_Instance_Renamings): Fix typo. * exp_dbug.adb (Build_Subprogram_Instance_Renamings): Build the renaming only for actuals of formal objects. diff --git a/gcc/ada/exp_dbug.adb b/gcc/ada/exp_dbug.adb --- a/gcc/ada/exp_dbug.adb +++ b/gcc/ada/exp_dbug.adb @@ -1028,6 +1028,7 @@ package body Exp_Dbug is E := First_Entity (Wrapper); while Present (E) loop if Nkind (Parent (E)) = N_Object_Declaration + and then Present (Corresponding_Generic_Association (Parent (E))) and then Is_Elementary_Type (Etype (E)) then Loc := Sloc (Expression (Parent (E))); diff --git a/gcc/ada/exp_dbug.ads b/gcc/ada/exp_dbug.ads --- a/gcc/ada/exp_dbug.ads +++ b/gcc/ada/exp_dbug.ads @@ -1444,7 +1444,7 @@ package Exp_Dbug is -- placed within the wrapper package of the instance, and the entity in -- these declarations is encoded in a complex way that GDB does not handle -- well. These new renaming declarations appear within the body of the - -- subprogram, and are redundant from a visibility point of view, but They + -- subprogram, and are redundant from a visibility point of view, but they -- should have no measurable performance impact, and require no special -- decoding in the debugger.