This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix regressions in libgomp testsuite: set flag_fat_lto_objects for offload
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Ilya Verbin <iverbin at gmail dot com>
- Cc: Richard Biener <richard dot guenther at gmail dot com>, Jakub Jelinek <jakub at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Kirill Yukhin <kirill dot yukhin at gmail dot com>
- Date: Fri, 14 Nov 2014 08:46:38 -0800
- Subject: Re: [PATCH] Fix regressions in libgomp testsuite: set flag_fat_lto_objects for offload
- Authentication-results: sourceware.org; auth=none
- References: <20141114160441 dot GA40445 at msticlxl57 dot ims dot intel dot com> <20141114160709 dot GB40445 at msticlxl57 dot ims dot intel dot com>
On Fri, Nov 14, 2014 at 8:07 AM, Ilya Verbin <iverbin@gmail.com> wrote:
> <Resending to gcc-patches@gcc.gnu.org>
>
> Hi,
>
> This patch fixes recent regressions in libgomp testsuite:
> https://gcc.gnu.org/ml/gcc-regression/2014-11/msg00343.html
> They are reproducible only with ld from trunk, ld 2.24 works fine.
>
> When GCC emits sections with offload IR, it should not emit "__gnu_lto_slim"
> symbol, otherwise linker plugin tries to compile LTO IR, which is not present.
>
> Bootstrap and regtesting on x86_64-linux using binutils 20141114 in progress.
> OK for trunk when finished?
>
> Thanks,
> -- Ilya
>
>
> gcc/
> * cgraphunit.c (symbol_table::compile): Set flag_fat_lto_objects
> in case of g->have_offload.
>
>
> diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
> index 534c613..584a84e 100644
> --- a/gcc/cgraphunit.c
> +++ b/gcc/cgraphunit.c
> @@ -2178,7 +2178,10 @@ symbol_table::compile (void)
>
> /* Offloading requires LTO infrastructure. */
> if (!in_lto_p && g->have_offload)
> - flag_generate_lto = 1;
> + {
> + flag_generate_lto = 1;
> + flag_fat_lto_objects = 1;
> + }
>
> /* If LTO is enabled, initialize the streamer hooks needed by GIMPLE. */
> if (flag_generate_lto)
What happens when -flto is used on command line? Will we
generate both LTO IR and offload IR?
--
H.J.