Commit 45f46750 by Thomas Schwinge Committed by Thomas Schwinge

Make sure that OMP builtins are available in offloading compilers.

	gcc/
	* builtins.def (DEF_GOMP_BUILTIN): Also consider flag_offload_abi
	for registering builtins.
	* config/i386/intelmic-mkoffload.c (prepare_target_image): Don't
	add -fopenmp to the argv_obstack used when invoking
	compile_for_target.

From-SVN: r219346
parent 4f929d9d
2015-01-08 Thomas Schwinge <thomas@codesourcery.com> 2015-01-08 Thomas Schwinge <thomas@codesourcery.com>
* builtins.def (DEF_GOMP_BUILTIN): Also consider flag_offload_abi
for registering builtins.
* config/i386/intelmic-mkoffload.c (prepare_target_image): Don't
add -fopenmp to the argv_obstack used when invoking
compile_for_target.
* config/i386/intelmic-mkoffload.c (compile_for_target): Always * config/i386/intelmic-mkoffload.c (compile_for_target): Always
add "-m32" or "-m64" to argv_obstack. add "-m32" or "-m64" to argv_obstack.
(generate_host_descr_file): Likewise, when invoking host_compiler. (generate_host_descr_file): Likewise, when invoking host_compiler.
......
...@@ -148,11 +148,14 @@ along with GCC; see the file COPYING3. If not see ...@@ -148,11 +148,14 @@ along with GCC; see the file COPYING3. If not see
/* Builtin used by the implementation of GNU OpenMP. None of these are /* Builtin used by the implementation of GNU OpenMP. None of these are
actually implemented in the compiler; they're all in libgomp. */ actually implemented in the compiler; they're all in libgomp. */
/* These builtins also need to be enabled in offloading compilers invoked from
mkoffload; for that purpose, we're checking the -foffload-abi flag here. */
#undef DEF_GOMP_BUILTIN #undef DEF_GOMP_BUILTIN
#define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \ #define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \ DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
false, true, true, ATTRS, false, \ false, true, true, ATTRS, false, \
(flag_openmp || flag_tree_parallelize_loops)) (flag_openmp || flag_tree_parallelize_loops \
|| flag_offload_abi != OFFLOAD_ABI_UNSET))
/* Builtin used by implementation of Cilk Plus. Most of these are decomposed /* Builtin used by implementation of Cilk Plus. Most of these are decomposed
by the compiler but a few are implemented in libcilkrts. */ by the compiler but a few are implemented in libcilkrts. */
......
...@@ -390,7 +390,6 @@ prepare_target_image (const char *target_compiler, int argc, char **argv) ...@@ -390,7 +390,6 @@ prepare_target_image (const char *target_compiler, int argc, char **argv)
obstack_init (&argv_obstack); obstack_init (&argv_obstack);
obstack_ptr_grow (&argv_obstack, target_compiler); obstack_ptr_grow (&argv_obstack, target_compiler);
obstack_ptr_grow (&argv_obstack, "-xlto"); obstack_ptr_grow (&argv_obstack, "-xlto");
obstack_ptr_grow (&argv_obstack, "-fopenmp");
obstack_ptr_grow (&argv_obstack, "-shared"); obstack_ptr_grow (&argv_obstack, "-shared");
obstack_ptr_grow (&argv_obstack, "-fPIC"); obstack_ptr_grow (&argv_obstack, "-fPIC");
obstack_ptr_grow (&argv_obstack, opt1); obstack_ptr_grow (&argv_obstack, opt1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment