From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57376 invoked by alias); 11 Sep 2015 14:23:17 -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 57364 invoked by uid 89); 11 Sep 2015 14:23:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Sep 2015 14:23:15 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ZaPEN-0001Ql-Fi from joseph_myers@mentor.com ; Fri, 11 Sep 2015 07:23:11 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.3.224.2; Fri, 11 Sep 2015 15:23:09 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1ZaPEK-0001tq-6g; Fri, 11 Sep 2015 14:23:08 +0000 Date: Fri, 11 Sep 2015 14:29:00 -0000 From: Joseph Myers To: Bernd Schmidt CC: , , Nathan Sidwell , Subject: Re: Ping^2 Re: Pass -foffload targets from driver to libgomp at link time In-Reply-To: <55F18D87.6070208@redhat.com> Message-ID: References: <55F18D87.6070208@redhat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2015-09/txt/msg00804.txt.bz2 On Thu, 10 Sep 2015, Bernd Schmidt wrote: > On 09/10/2015 03:41 PM, Joseph Myers wrote: > > Ping^2. This patch > > is still > > pending review. > > No fundamental objections, but I have some questions. Cuold you describe > what the handling of flags/lang_mask accomplishes in this patch? Would > option handling be simpler if the creation/compilation of the extra file > happened in lto_wrapper (where we already do similar things through > mkoffload)? The point of the lang_mask handling is that if, say, we're compiling C++ or Fortran code, with options that aren't valid for C, we mustn't pass those options to cc1 when building the constructor as C code, but we do still need to pass options valid for C (which might e.g. affect the ABI). There's an argument that this sort of option filtering should be done more generally. That is, if we have a mixed-language compilation in a single call to the driver, it should filter the options so that cc1 gets those options applicable for C, cc1plus those applicable to C++, etc., with options for inappropriate languages only being diagnosed if none of the source files are for that language. I don't know if that's the right thing to do or not, but it's at least plausible. I don't see lto-wrapper as being any easier as a place to do this; no doubt lto-wrapper or collect2 could create the file and call back into the driver to compile it, but I don't see the advantage in doing that over having the driver (which already has all the relevant information, since it's coming from the command line rather than inspection of object files being linked) do it. > I initially thought the information you're giving to > GOMP_set_offload_targets is already available implicitly, from the calls > to GOMP_offload_register. But digging through the archives it sounds > like the problem is that if there's no offloadable code, no offload > image will be generated. Is that correct? Yes. In the message Thomas referred to, "On the other hand, for example, for -foffload=nvptx-none, even if user program code doesn't contain any offloaded data (and thus the offload machinery has not been run), the user program might still contain any executable directives or OpenACC runtime library calls, so we'd still like to use the libgomp nvptx plugin. However, we currently cannot detect this situation.". -- Joseph S. Myers joseph@codesourcery.com