From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72578 invoked by alias); 25 Jan 2016 13:27:55 -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 72464 invoked by uid 89); 25 Jan 2016 13:27:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:c09, H*RU:400c, H*RU:c09, Hx-spam-relays-external:400c X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 25 Jan 2016 13:27:51 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48485) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1aNhBM-0002mH-Rb for gcc-patches@gnu.org; Mon, 25 Jan 2016 08:27:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aNhBH-0007Qj-AW for gcc-patches@gnu.org; Mon, 25 Jan 2016 08:27:48 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:35312) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aNhBH-0007Pm-40 for gcc-patches@gnu.org; Mon, 25 Jan 2016 08:27:43 -0500 Received: by mail-wm0-x230.google.com with SMTP id r129so63999201wmr.0 for ; Mon, 25 Jan 2016 05:27:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=XAaUm1f2nyFIVxw/zvdUesg1749gCZun8slhJVGZzQc=; b=CO7mpdt3dlv5sOXatlkCNkewaE45zBHHZx0vglmuJbjbYn1mRG5T0IYgUIuAyS53+/ 7uNerVF2GsXfJpKCaVPqUcimalFHUXgccfLR0WHjgZoqZvH4SAFGeaSPo8ytrt9yDF2j S2Zc9EmIbEf9CgDOMw1yTnuXJOWHpga/sUHg4Nafiw3NU2i6PAs7pL34gppjIRfc+pUr SbzOW9MMO5l1jSoANAkNhmHm4EMT85ZmyL41T1Nln3FuVs/CKIP+fekboHuBi4/r8fdi 4/fEBRrermwFyRfDtjL7nUpSIa7xBjRoun+WqERoRqfO6pFdk2jh7xRWWT1ho/S9W7LM sUOg== X-Gm-Message-State: AG10YOTsEfc43Lme43VDbGkvCcwPxzsOrGYRNPGEpXOhKaCncIhJnsavPxNRHYNIs+wXNw== X-Received: by 10.28.144.10 with SMTP id s10mr17402489wmd.97.1453728459612; Mon, 25 Jan 2016 05:27:39 -0800 (PST) Received: from msticlxl57.ims.intel.com (irdmzpr01-ext.ir.intel.com. [192.198.151.36]) by smtp.gmail.com with ESMTPSA id z127sm16205261wme.2.2016.01.25.05.27.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jan 2016 05:27:39 -0800 (PST) Date: Mon, 25 Jan 2016 13:27:00 -0000 From: Ilya Verbin To: Tom de Vries Cc: Richard Biener , Thomas Schwinge , Jakub Jelinek , "gcc-patches@gnu.org" Subject: Re: [PING][PATCH] Mark symbols in offload tables with force_output in read_offload_tables Message-ID: <20160125132703.GA43532@msticlxl57.ims.intel.com> References: <565DADE6.8020908@mentor.com> <87zixsloli.fsf@kepler.schwinge.homeip.net> <565F7F68.1080903@mentor.com> <565F8881.90609@mentor.com> <565F8C69.1070906@mentor.com> <566022D0.2030906@mentor.com> <56697AC5.7060902@mentor.com> <56718B13.4040601@mentor.com> <568BD98F.7020908@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <568BD98F.7020908@mentor.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::230 X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg01870.txt.bz2 Hi! On Tue, Jan 05, 2016 at 15:56:15 +0100, Tom de Vries wrote: > >diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c > >index 62e5454..cdaee41 100644 > >--- a/gcc/lto-cgraph.c > >+++ b/gcc/lto-cgraph.c > >@@ -1911,6 +1911,11 @@ input_offload_tables (void) > > tree fn_decl > > = lto_file_decl_data_get_fn_decl (file_data, decl_index); > > vec_safe_push (offload_funcs, fn_decl); > >+ > >+ /* Prevent IPA from removing fn_decl as unreachable, since there > >+ may be no refs from the parent function to child_fn in offload > >+ LTO mode. */ > >+ cgraph_node::get (fn_decl)->mark_force_output (); > > } > > else if (tag == LTO_symtab_variable) > > { > >@@ -1918,6 +1923,10 @@ input_offload_tables (void) > > tree var_decl > > = lto_file_decl_data_get_var_decl (file_data, decl_index); > > vec_safe_push (offload_vars, var_decl); > >+ > >+ /* Prevent IPA from removing var_decl as unused, since there > >+ may be no refs to var_decl in offload LTO mode. */ > >+ varpool_node::get (var_decl)->force_output = 1; > > } This doesn't work when there is more than one LTO partition, because only first partition contains full offload table to maintain correct order, but cgraph and varpool nodes aren't necessarily created for the first partition. To reproduce: $ make check-target-libgomp RUNTESTFLAGS="c.exp=for-* --target_board=unix/-flto" FAIL: libgomp.c/for-3.c (internal compiler error) FAIL: libgomp.c/for-5.c (internal compiler error) FAIL: libgomp.c/for-6.c (internal compiler error) $ make check-target-libgomp RUNTESTFLAGS="c++.exp=for-* --target_board=unix/-flto" FAIL: libgomp.c++/for-11.C (internal compiler error) FAIL: libgomp.c++/for-13.C (internal compiler error) FAIL: libgomp.c++/for-14.C (internal compiler error) -- Ilya