From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1370 invoked by alias); 19 Sep 2019 13:28:26 -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 1310 invoked by uid 89); 19 Sep 2019 13:28:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=Present, exp_unst, exp_unstadb, UD:exp_unst.adb X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Sep 2019 13:28:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8CDF056028; Thu, 19 Sep 2019 09:28:19 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 1HL0ozikrkyj; Thu, 19 Sep 2019 09:28:19 -0400 (EDT) Received: from tron.gnat.com (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) by rock.gnat.com (Postfix) with ESMTP id 7056656025; Thu, 19 Sep 2019 09:28:19 -0400 (EDT) Received: by tron.gnat.com (Postfix, from userid 4862) id 6F3236B4; Thu, 19 Sep 2019 09:28:19 -0400 (EDT) Date: Thu, 19 Sep 2019 13:29:00 -0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Gary Dismukes Subject: [Ada] Suppress GNAT FE up-level reference transformation for GNAT-LLVM Message-ID: <20190919132819.GA41768@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="pWyiEgJYm5f9v55/" Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg01180.txt.bz2 --pWyiEgJYm5f9v55/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 592 In the case of GNAT-LLVM, the GNAT FE no longer does expansion of up-level references identified by the subprogram unnesting machinery into activation record references. This is now only done by the FE when generating C code. This expansion is already taken care of by the gnat-llvm middle phase, so there's no benefit to also doing it in the front end. Tested on x86_64-pc-linux-gnu, committed on trunk 2019-09-19 Gary Dismukes gcc/ada/ * exp_unst.adb (Unnest_Subprogram): Bypass the transformation of up-level references unless Opt.Generate_C_Code is enabled. --pWyiEgJYm5f9v55/ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" Content-length: 882 --- gcc/ada/exp_unst.adb +++ gcc/ada/exp_unst.adb @@ -2177,11 +2177,14 @@ package body Exp_Unst is -- not need rewriting (e.g. the appearence in a conversion). -- Also ignore if no reference was specified or if the rewriting -- has already been done (this can happen if the N_Identifier - -- occurs more than one time in the tree). + -- occurs more than one time in the tree). Also ignore references + -- when not generating C code (in particular for the case of LLVM, + -- since GNAT-LLVM will handle the processing for up-level refs). if No (UPJ.Ref) or else not Is_Entity_Name (UPJ.Ref) or else not Present (Entity (UPJ.Ref)) + or else not Opt.Generate_C_Code then goto Continue; end if; --pWyiEgJYm5f9v55/--