[PATCH 12/12] always define ENABLE_OFFLOADING
Thomas Schwinge
thomas@codesourcery.com
Tue Nov 24 18:14:00 GMT 2015
Hi!
On Mon, 23 Nov 2015 19:52:08 +0300, Ilya Verbin <iverbin@gmail.com> wrote:
> There are 2 new uses of "#ifdef ENABLE_OFFLOADING" in c_parser_oacc_declare and
> cp_parser_oacc_declare.
> I don't know how to properly test OpenACC, so here is untested patch.
"make check"? ;-) (Offloading currently will happen for OpenACC only if
a nvptx offload target has been configured, though.)
Thanks for the patch -- please commit this as an obvious fixup for the
trunk commit transforming ENABLE_OFFLOADING.
> --- a/gcc/c/c-parser.c
> +++ b/gcc/c/c-parser.c
> @@ -13473,14 +13473,15 @@ c_parser_oacc_declare (c_parser *parser)
> if (node != NULL)
> {
> node->offloadable = 1;
> -#ifdef ENABLE_OFFLOADING
> - g->have_offload = true;
> - if (is_a <varpool_node *> (node))
> + if (ENABLE_OFFLOADING)
> {
> - vec_safe_push (offload_vars, decl);
> - node->force_output = 1;
> + g->have_offload = true;
> + if (is_a <varpool_node *> (node))
> + {
> + vec_safe_push (offload_vars, decl);
> + node->force_output = 1;
> + }
> }
> -#endif
> }
> }
> }
> diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
> index 24ed404..a9c0a45 100644
> --- a/gcc/cp/parser.c
> +++ b/gcc/cp/parser.c
> @@ -34633,14 +34633,15 @@ cp_parser_oacc_declare (cp_parser *parser, cp_token *pragma_tok)
> if (node != NULL)
> {
> node->offloadable = 1;
> -#ifdef ENABLE_OFFLOADING
> - g->have_offload = true;
> - if (is_a <varpool_node *> (node))
> + if (ENABLE_OFFLOADING)
> {
> - vec_safe_push (offload_vars, decl);
> - node->force_output = 1;
> + g->have_offload = true;
> + if (is_a <varpool_node *> (node))
> + {
> + vec_safe_push (offload_vars, decl);
> + node->force_output = 1;
> + }
> }
> -#endif
> }
> }
> }
Grüße
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151124/9e661046/attachment.sig>
More information about the Gcc-patches
mailing list