From d4852cd492d78002c1a8e213ab858672ab54106e Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Fri, 2 Oct 2015 21:27:30 +0200 Subject: [PATCH] [PR target/67822] OpenMP offloading to nvptx fails gcc/ PR target/67822 * config/nvptx/mkoffload.c (main): Scan the argument vector for -fopenmp, and skip generating an offloading image if specified. From-SVN: r228414 --- gcc/ChangeLog | 6 ++++++ gcc/config/nvptx/mkoffload.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3f7561a0c57..1317a2d6d5e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-10-02 Thomas Schwinge + + PR target/67822 + * config/nvptx/mkoffload.c (main): Scan the argument vector for + -fopenmp, and skip generating an offloading image if specified. + 2015-10-02 Uros Bizjak * system.h (ROUND_UP): New macro definition. diff --git a/gcc/config/nvptx/mkoffload.c b/gcc/config/nvptx/mkoffload.c index 926c82beea9..69eb4eac415 100644 --- a/gcc/config/nvptx/mkoffload.c +++ b/gcc/config/nvptx/mkoffload.c @@ -1030,6 +1030,7 @@ main (int argc, char **argv) expandargv (&argc, &argv); /* Scan the argument vector. */ + bool fopenmp = false; for (int i = 1; i < argc; i++) { #define STR "-foffload-abi=" @@ -1044,6 +1045,8 @@ main (int argc, char **argv) "unrecognizable argument of option " STR); } #undef STR + else if (strcmp (argv[i], "-fopenmp") == 0) + fopenmp = true; else if (strcmp (argv[i], "-v") == 0) verbose = true; } @@ -1082,8 +1085,8 @@ main (int argc, char **argv) fatal_error (input_location, "cannot open '%s'", ptx_cfile_name); /* PR libgomp/65099: Currently, we only support offloading in 64-bit - configurations. */ - if (offload_abi == OFFLOAD_ABI_LP64) + configurations. PR target/67822: OpenMP offloading to nvptx fails. */ + if (offload_abi == OFFLOAD_ABI_LP64 && !fopenmp) { ptx_name = make_temp_file (".mkoffload"); obstack_ptr_grow (&argv_obstack, "-o"); -- 2.30.2