This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: OMP builtins in offloading (was: [PATCH 1/4] Add mkoffload for Intel MIC)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: Ilya Verbin <iverbin at gmail dot com>, gcc-patches at gcc dot gnu dot org, Kirill Yukhin <kirill dot yukhin at gmail dot com>, Andrey Turetskiy <andrey dot turetskiy at gmail dot com>, Bernd Schmidt <bernds at codesourcery dot com>
- Date: Mon, 22 Dec 2014 12:26:57 +0100
- Subject: Re: OMP builtins in offloading (was: [PATCH 1/4] Add mkoffload for Intel MIC)
- Authentication-results: sourceware.org; auth=none
- References: <20141021171323 dot GA47586 at msticlxl57 dot ims dot intel dot com> <20141021171602 dot GB47586 at msticlxl57 dot ims dot intel dot com> <20141022082103 dot GH10376 at tucnak dot redhat dot com> <20141022185701 dot GA21398 at msticlxl57 dot ims dot intel dot com> <87wq5kylph dot fsf at kepler dot schwinge dot homeip dot net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Dec 22, 2014 at 12:20:58PM +0100, Thomas Schwinge wrote:
> On Wed, 22 Oct 2014 22:57:01 +0400, Ilya Verbin <iverbin@gmail.com> wrote:
> > --- /dev/null
> > +++ b/gcc/config/i386/intelmic-mkoffload.c
> > @@ -0,0 +1,541 @@
> > +/* Offload image generation tool for Intel MIC devices.
>
> > +static const char *
> > +prepare_target_image (const char *target_compiler, int argc, char **argv)
> > +{
> > + [...]
> > + obstack_init (&argv_obstack);
> > + obstack_ptr_grow (&argv_obstack, target_compiler);
> > + obstack_ptr_grow (&argv_obstack, "-xlto");
> > + obstack_ptr_grow (&argv_obstack, "-fopenmp");
> > + obstack_ptr_grow (&argv_obstack, "-shared");
> > + obstack_ptr_grow (&argv_obstack, "-fPIC");
> > + obstack_ptr_grow (&argv_obstack, opt1);
>
> What is the reason that you're adding -fopenmp here? I assume it is that
> otherwise you'd get tree streaming errors because of different builtins
> configurations, like this?
>
> $ [...]/build-gcc/gcc/xgcc -B[...]/build-gcc/gcc/ [...]/source-gcc/libgomp/testsuite/libgomp.oacc-c/../libgomp.oacc-c-c++-common/collapse-1.c -B[...]/build-gcc/x86_64-unknown-linux-gnu/./libgomp/ -B[...]/build-gcc/x86_64-unknown-linux-gnu/./libgomp/.libs -I[...]/build-gcc/x86_64-unknown-linux-gnu/./libgomp -I[...]/source-gcc/libgomp/testsuite/../../include -I[...]/source-gcc/libgomp/testsuite/.. -fmessage-length=0 -fno-diagnostics-show-caret -fdiagnostics-color=never -B[...]/install/offload-x86_64-intelmicemul-linux-gnu/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0 -B[...]/install/offload-x86_64-intelmicemul-linux-gnu/bin -fopenacc -DACC_DEVICE_TYPE_host_nonshm=1 -DACC_MEM_SHARED=0 -O2 -L[...]/build-gcc/x86_64-unknown-linux-gnu/./libgomp/.libs -lm -o ./collapse-1.exe
> lto1: internal compiler error: in streamer_get_builtin_tree, at tree-streamer-in.c:1136
> 0xc0b7ff streamer_get_builtin_tree(lto_input_block*, data_in*)
> [...]/source-gcc/gcc/tree-streamer-in.c:1136
> 0x8f7cc4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int)
> [...]/source-gcc/gcc/lto-streamer-in.c:1303
> 0x8f7ee0 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*)
> [...]/source-gcc/gcc/lto-streamer-in.c:1231
> 0x5e9bee lto_read_decls
> [...]/source-gcc/gcc/lto/lto.c:1889
> 0x5ebc5c lto_file_finalize
> [...]/source-gcc/gcc/lto/lto.c:2218
> 0x5ebc5c lto_create_files_from_ids
> [...]/source-gcc/gcc/lto/lto.c:2228
> 0x5ebc5c lto_file_read
> [...]/source-gcc/gcc/lto/lto.c:2269
> 0x5ebc5c read_cgraph_and_symbols
> [...]/source-gcc/gcc/lto/lto.c:2969
> 0x5ebc5c lto_main()
> [...]/source-gcc/gcc/lto/lto.c:3424
> [...]
> mkoffload-intelmic: fatal error: [...]/install/offload-x86_64-intelmicemul-linux-gnu/bin//x86_64-unknown-linux-gnu-accel-x86_64-intelmicemul-linux-gnu-gcc returned 1 exit status
> compilation terminated.
> lto-wrapper: fatal error: [...]/install/offload-x86_64-intelmicemul-linux-gnu/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0//accel/x86_64-intelmicemul-linux-gnu/mkoffload returned 1 exit status
> compilation terminated.
> [...]/ld: lto-wrapper failed
> collect2: error: ld returned 1 exit status
>
> If that is the "only" reason to add -fopenmp there, can we then instead
> do the following?
>
> gcc/builtins.def | 8 ++++++--
> gcc/config/i386/intelmic-mkoffload.c | 1 -
> 2 files changed, 6 insertions(+), 3 deletions(-)
If Ilya confirms that is the sole reason, I'm fine with this change.
Please write ChangeLog entry for it.
Jakub