aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-wrapper.c
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-06-29 15:58:21 +0200
committerTobias Burnus <tobias@codesourcery.com>2021-06-29 16:00:04 +0200
commit33c4e466243f2d0459d9a4d0cadc1b38a3741f3e (patch)
tree1a57bf8b8455b470e352f1265f01d8bc19999cc7 /gcc/lto-wrapper.c
parent489c5dcf7b063000a5e223535eb425cf9748720a (diff)
downloadgcc-33c4e466243f2d0459d9a4d0cadc1b38a3741f3e.zip
gcc-33c4e466243f2d0459d9a4d0cadc1b38a3741f3e.tar.gz
gcc-33c4e466243f2d0459d9a4d0cadc1b38a3741f3e.tar.bz2
Add 'default' to -foffload=; document that flag [PR67300]
As -foffload={options,targets,targets=options} is very convoluted, it has been split into -foffload=targets (supporting the old syntax for backward compatibilty) and -foffload-options={options,target=options}. Only the new syntax is documented. Additionally, -foffload=default is supported, which can reset the devices after -foffload=disable / -foffload=targets to the default, if needed. gcc/ChangeLog: PR other/67300 * common.opt (-foffload=): Update description. (-foffload-options=): New. * doc/invoke.texi (C Language Options): Document -foffload and -foffload-options. * gcc.c (check_offload_target_name): New, split off from handle_foffload_option. (check_foffload_target_names): New. (handle_foffload_option): Handle -foffload=default. (driver_handle_option): Update for -foffload-options. * lto-opts.c (lto_write_options): Use -foffload-options instead of -foffload. * lto-wrapper.c (merge_and_complain, append_offload_options): Likewise. * opts.c (common_handle_option): Likewise. libgomp/ChangeLog: PR other/67300 * testsuite/libgomp.c-c++-common/reduction-16.c: Replace -foffload=nvptx-none= by -foffload-options=nvptx-none= to avoid disabling other offload targets. * testsuite/libgomp.c-c++-common/reduction-5.c: Likewise. * testsuite/libgomp.c-c++-common/reduction-6.c: Likewise. * testsuite/libgomp.c/target-44.c: Likewise.
Diffstat (limited to 'gcc/lto-wrapper.c')
-rw-r--r--gcc/lto-wrapper.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 1c26439..aae48af 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -453,7 +453,7 @@ merge_and_complain (vec<cl_decoded_option> decoded_options,
break;
- case OPT_foffload_:
+ case OPT_foffload_options_:
decoded_options.safe_push (*foption);
break;
@@ -833,7 +833,7 @@ append_offload_options (obstack *argv_obstack, const char *target,
unsigned argc;
cl_decoded_option *option = &options[i];
- if (option->opt_index != OPT_foffload_)
+ if (option->opt_index != OPT_foffload_options_)
continue;
/* If option argument starts with '-' then no target is specified. That
@@ -844,11 +844,7 @@ append_offload_options (obstack *argv_obstack, const char *target,
else
{
opts = strchr (option->arg, '=');
- /* If there are offload targets specified, but no actual options,
- there is nothing to do here. */
- if (!opts)
- continue;
-
+ gcc_assert (opts);
cur = option->arg;
while (cur < opts)