From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by sourceware.org (Postfix) with ESMTPS id 1E8A43851C0D for ; Thu, 24 Sep 2020 09:51:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E8A43851C0D Received: by mail-ej1-x643.google.com with SMTP id z22so3590747ejl.7 for ; Thu, 24 Sep 2020 02:51:40 -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=izOjJ8HZcz0FUZRuyWcj+Q+LjsvbqHJ/qNFX2f4Tqew=; b=Ln6NILzdtQXbtZ2hG/m1nOHGIJYXMGexIANs6P5jItnJ2OMLqDregwNxw52I5t8oPA KG7Tu4MlVQAb9UAoTkT4xaGUtwIMUFGDo+UHRhjP17H2OdJ5JnHEgEtjGZBN/LpgFV3i w1x0wjZGnhbkNvgZuKrq96Wf1AO5UjaBs9a60CO9RXYH8TKog2eNSOi02VD8PZkeaM8t uNmuZ124/vaEopgDlMvhlu/+QEDH1EHgoSQsjShfVM4dWBMGTRCvSlJQarldmYsIdNPo 4cYE3k2URSi7Zdf4cj/AgJYfd+AQF+KzTw79p62LSuT5GJLX1DVAOZ59p5rydyTrVgh1 Sj/A== X-Gm-Message-State: AOAM533xspmYtpJcWKF//+FMCYx1Wew6EhpLaJA97wcMfA7fSdOlwiUq Qr/dYw57WlPwaprfy1CKU98bdzde/3is66jLllc= X-Google-Smtp-Source: ABdhPJxx/s2eRzzaVwNAlovzI0ATqfHJVUxis+J5Fyt+lRxxnZ5U/CmL2F49J3BbaAlN2vMHwhxKxXsE35OnkZGmIxY= X-Received: by 2002:a17:906:552:: with SMTP id k18mr120644eja.482.1600941099234; Thu, 24 Sep 2020 02:51:39 -0700 (PDT) MIME-Version: 1.0 References: <4250958d-f7bf-1a0a-31d2-63eff191b258@codesourcery.com> <0e22d8c5-1008-cad4-c131-57ee3950a73a@codesourcery.com> <26b07ad0-ba42-b2c6-2325-cad7360f8e2c@codesourcery.com> <54a8767f-3cfe-a3ca-6149-0a6d3ee0b6d9@codesourcery.com> <731ae3cb-847c-6813-0d07-af835a54149c@codesourcery.com> <20200924094935.GJ2176@tucnak> In-Reply-To: <20200924094935.GJ2176@tucnak> From: Richard Biener Date: Thu, 24 Sep 2020 11:51:28 +0200 Message-ID: Subject: Re: [Patch] LTO: Force externally_visible for offload_vars/funcs (PR97179) To: Jakub Jelinek Cc: Tobias Burnus , gcc-patches , Richard Biener , Jan Hubicka Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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, 24 Sep 2020 09:51:41 -0000 On Thu, Sep 24, 2020 at 11:50 AM Jakub Jelinek via Gcc-patches wrote: > > On Thu, Sep 24, 2020 at 11:41:00AM +0200, Tobias Burnus wrote: > > Following Jakub's suggestion, I also added > > __attribute__((used)) > > to the tree belonging to both tables in omp-offload.c's omp_finish > > but that did not help, either. > > That is really DECL_PRESERVED_P, the attribute is turned into that, so no > need to have attribute around after setting it. > That is needed (but already done), but clearly not sufficient. > What we need to emulate is the effect of all those decls being referenced > from a single (preserved) initializer, which would need to refer to their > names too. Except we don't really have such a var and initializer > constructed early enough probably. > Now, for vars with initializers I think there is > record_references_in_initializer to remember those references, so do we need > to emulate that behavior? > Or, see what effects it has on the partitioning, and if it means forcing all > the referenced decls that aren't TREE_PUBLIC into the same partition, do it > for the offloading funcs and vars too? Create the offload table at WPA time so we get to see it during partitioning? > Jakub >