From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 75635384B13C for ; Thu, 24 Sep 2020 09:49:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 75635384B13C Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-279-e3b8likSPk6TVyXcWQhalA-1; Thu, 24 Sep 2020 05:49:42 -0400 X-MC-Unique: e3b8likSPk6TVyXcWQhalA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39C78801001; Thu, 24 Sep 2020 09:49:41 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-112-37.ams2.redhat.com [10.36.112.37]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C85345C1C7; Thu, 24 Sep 2020 09:49:40 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id 08O9nbSu005451; Thu, 24 Sep 2020 11:49:37 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id 08O9nZAp005450; Thu, 24 Sep 2020 11:49:35 +0200 Date: Thu, 24 Sep 2020 11:49:35 +0200 From: Jakub Jelinek To: Tobias Burnus Cc: Richard Biener , gcc-patches , Jan Hubicka Subject: Re: [Patch] LTO: Force externally_visible for offload_vars/funcs (PR97179) Message-ID: <20200924094935.GJ2176@tucnak> Reply-To: Jakub Jelinek 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> MIME-Version: 1.0 In-Reply-To: <731ae3cb-847c-6813-0d07-af835a54149c@codesourcery.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, 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:49:45 -0000 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? Jakub