From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id 247593954C5D for ; Thu, 2 Jun 2022 09:09:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 247593954C5D Received: by mail-ej1-x62f.google.com with SMTP id fu3so7223720ejc.7 for ; Thu, 02 Jun 2022 02:09:14 -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=ZMy5nOtl72irQXZipP7O6v9VR2SweaGnhlih6sbz0yw=; b=ej33znC0zC3T009Dv48Vv8tNvIuWMbsRL4vwxoqi8RyXrUvaWYMemw7MwK1aExFBsZ NcyG7nGzk3cC9ujqy4bpjdJhIfwrryIv55m3kzHbkzDyal/8EmbLRzgQ7MFbkH98GuZE 5xxyM63jJ639i/bqyalmyY3gXfCvHvLQWkkipzQNd9KAIr1CcmpjIpSoe4NtBtUCyrpx nUPCA7is3BOtNfk+7t0SZTJPFuVukTO+mpIpVxdSAvW+StJj2pvXePKTVkRVMrNntaot e70+tSfPBkkcV1v13mVClYiczto+MUyFmxBTP/TQeW+cenoqTaPOqS1GsdpvK7Sl9cSh 9tYQ== X-Gm-Message-State: AOAM532uQv+svvODtdfYcswqU3iqIZuQu9bqei6SvqVHR4U3/y/f8Jcj +TSfp3M6APca/mI0jaRwPYXjj+NQaTiwrA== X-Google-Smtp-Source: ABdhPJxvyh8qPNsQ+Oh4/F8zM0sMBNla8BxQQrqZZL+aMwxVy3/gzMKQxF7W+e4+0dgk+4/REbHDLA== X-Received: by 2002:a17:907:6e8b:b0:6fe:bb0c:9e6b with SMTP id sh11-20020a1709076e8b00b006febb0c9e6bmr3256879ejc.106.1654160953719; Thu, 02 Jun 2022 02:09:13 -0700 (PDT) Received: from adacore.com ([45.147.211.82]) by smtp.gmail.com with ESMTPSA id lw6-20020a170906bcc600b006fe9e717143sm1529870ejb.94.2022.06.02.02.09.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 02:09:13 -0700 (PDT) Date: Thu, 2 Jun 2022 09:09:12 +0000 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Never make symbols for thunks public Message-ID: <20220602090912.GA1010969@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="a8Wt8u1KmwUX3Y2C" 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-List-Received-Date: Thu, 02 Jun 2022 09:09:15 -0000 --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Thunks are only referenced locally by dispatch tables and never inlined. Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch6.adb (Analyze_Subprogram_Body_Helper): Clear the Is_Public flag on thunks. --a8Wt8u1KmwUX3Y2C Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="patch.diff" diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -4772,6 +4772,13 @@ package body Sem_Ch6 is if Nkind (N) /= N_Subprogram_Body or else not Was_Expression_Function (N) then + -- First clear the Is_Public flag on thunks since they are only + -- referenced locally by dispatch tables and thus never inlined. + + if Is_Thunk (Body_Id) then + Set_Is_Public (Body_Id, False); + end if; + Freeze_Before (N, Body_Id); end if; --a8Wt8u1KmwUX3Y2C--