On Thu, Jun 17, 2021 at 02:08:07PM +0200, Tobias Burnus wrote:
> +@item -foffload=@var{offload-target-triplet}
> +@itemx -foffload=@var{offload-target-triplet}=@var{flags}
> +@itemx -foffload=@var{flags}
> +@opindex foffload
> +@cindex Offloading
> +@cindex OpenACC
> +@cindex OpenMP
> +Specifies for which offload/non-host/accelerator devices code should
> +be generated when using OpenACC (@option{-fopenacc}) -- or OpenMP
> +(@option{-fopenmp}) with target regions. It additionally permits to
> +pass arguments to the offload-target compiler. Note that code compiled
> +for one or more offload-target devices can still be executable when some
> +or all offload device are unavailable at runtime, in line with and as
> +specified by the OpenACC and OpenMP specifications.
I think default is not offload-target-triplet, so either we should rename
the @var and then say that it is either offload-target-triplet or
@code{default} or @code{disable}, or we should list those default and
disable cases above as separate @itemx.
> --- a/gcc/gcc.c
> +++ b/gcc/gcc.c
> @@ -4015,6 +4015,13 @@ handle_foffload_option (const char *arg)
> break;
> }
>
> + if (strcmp (target, "default") == 0)
> + {
> + free (offload_targets);
> + offload_targets = xstrdup (OFFLOAD_TARGETS);
> + break;
> + }
> +
How does this interact with --enable-offload-defaulted ? Won't
-fopenmp=default=-lm force in all configured targets even when say
nvptx-none mkoffload/offloading compiler is missing?
And how does it interact with previous -foffload=?
I mean, -foffload=nvptx-none=-latomic -foffload=default=-lm
Jakub