From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16251 invoked by alias); 28 Nov 2014 08:42:42 -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 16242 invoked by uid 89); 28 Nov 2014 08:42:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 28 Nov 2014 08:42:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 44947AD89; Fri, 28 Nov 2014 08:42:36 +0000 (UTC) Date: Fri, 28 Nov 2014 09:32:00 -0000 From: Richard Biener To: Ilya Verbin cc: Jakub Jelinek , gcc-patches@gcc.gnu.org, Bernd Schmidt , Kirill Yukhin Subject: Re: [PATCH 6/n] OpenMP 4.0 offloading infrastructure: option handling In-Reply-To: <20141128000855.GA32423@msticlxl57.ims.intel.com> Message-ID: References: <20141011144900.GA16368@msticlxl57.ims.intel.com> <20141128000855.GA32423@msticlxl57.ims.intel.com> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2014-11/txt/msg03457.txt.bz2 On Fri, 28 Nov 2014, Ilya Verbin wrote: > On 11 Oct 18:49, Ilya Verbin wrote: > > (run_gcc): Outline options handling into the new functions: > > find_and_merge_options, append_compiler_options, append_linker_options. > > ... > > @@ -625,18 +893,13 @@ run_gcc (unsigned argc, char *argv[]) > > /* Look at saved options in the IL files. */ > > for (i = 1; i < argc; ++i) > > { > > ... > > + have_lto > > + = find_and_merge_options (fd, file_offset, LTO_SECTION_NAME_PREFIX, > > + &fdecoded_options, &fdecoded_options_count, > > + collect_gcc); > > + have_offload > > + = find_and_merge_options (fd, file_offset, OFFLOAD_SECTION_NAME_PREFIX, > > + &offload_fdecoded_options, > > + &offload_fdecoded_options_count, collect_gcc); > > close (fd); > > } > > I found a bug here, have_{lto,offload} must be set if at least one file contains > lto/offload sections, but currently they are overwritten by the last file. > Fix is bootstrapped and regtested on x86_64-linux. OK for trunk? Ok. Thanks, Richard. > > gcc/ > * lto-wrapper.c (run_gcc): Set have_lto and have_offload if at least one > file contains sections with LTO and offload IR, respectively. > > > diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c > index 9a540b4..0f69457 100644 > --- a/gcc/lto-wrapper.c > +++ b/gcc/lto-wrapper.c > @@ -921,13 +921,14 @@ run_gcc (unsigned argc, char *argv[]) > continue; > > have_lto > - = find_and_merge_options (fd, file_offset, LTO_SECTION_NAME_PREFIX, > - &fdecoded_options, &fdecoded_options_count, > - collect_gcc); > + |= find_and_merge_options (fd, file_offset, LTO_SECTION_NAME_PREFIX, > + &fdecoded_options, &fdecoded_options_count, > + collect_gcc); > have_offload > - = find_and_merge_options (fd, file_offset, OFFLOAD_SECTION_NAME_PREFIX, > - &offload_fdecoded_options, > - &offload_fdecoded_options_count, collect_gcc); > + |= find_and_merge_options (fd, file_offset, OFFLOAD_SECTION_NAME_PREFIX, > + &offload_fdecoded_options, > + &offload_fdecoded_options_count, > + collect_gcc); > close (fd); > } > > > -- Ilya > > -- Richard Biener SUSE LINUX GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer, HRB 21284 (AG Nuernberg) Maxfeldstrasse 5, 90409 Nuernberg, Germany