+2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR c/89433
+ * c-attribs.c (c_common_attribute_table): Set min_len to -1 for
+ "omp declare target".
+
2019-05-16 Martin Sebor <msebor@redhat.com>
* c-attribs.c (handle_no_sanitize_attribute): Quote identifiers,
handle_omp_declare_simd_attribute, NULL },
{ "simd", 0, 1, true, false, false, false,
handle_simd_attribute, NULL },
- { "omp declare target", 0, 0, true, false, false, false,
+ { "omp declare target", 0, -1, true, false, false, false,
handle_omp_declare_target_attribute, NULL },
{ "omp declare target link", 0, 0, true, false, false, false,
handle_omp_declare_target_attribute, NULL },
+2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR c/89433
+ * c-parser.c (c_finish_oacc_routine): Refer to OpenACC 'routine'
+ clauses from "omp declare target" attribute.
+
2019-05-16 Martin Sebor <msebor@redhat.com>
* c-decl.c (start_decl): Quote keywords, operators, and
/* Add an "omp declare target" attribute. */
DECL_ATTRIBUTES (fndecl)
= tree_cons (get_identifier ("omp declare target"),
- NULL_TREE, DECL_ATTRIBUTES (fndecl));
+ data->clauses, DECL_ATTRIBUTES (fndecl));
/* Remember that we've used this "#pragma acc routine". */
data->fndecl_seen = true;
+2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR c++/89433
+ * parser.c (cp_finalize_oacc_routine): Refer to OpenACC 'routine'
+ clauses from "omp declare target" attribute.
+
2019-05-16 Martin Sebor <msebor@redhat.com>
* call.c (print_z_candidate): Wrap diagnostic text in a gettext
/* Add an "omp declare target" attribute. */
DECL_ATTRIBUTES (fndecl)
= tree_cons (get_identifier ("omp declare target"),
- NULL_TREE, DECL_ATTRIBUTES (fndecl));
+ parser->oacc_routine->clauses, DECL_ATTRIBUTES (fndecl));
/* Don't unset parser->oacc_routine here: we may still need it to
diagnose wrong usage. But, remember that we've used this "#pragma acc
+2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR fortran/89433
+ * f95-lang.c (gfc_attribute_table): Set min_len to -1 for "omp
+ declare target".
+ * trans-decl.c (add_attributes_to_decl): Refer to OpenACC
+ 'routine' clauses from "omp declare target" attribute.
+
2019-05-16 Martin Sebor <msebor@redhat.com>
* gfortranspec.c (append_arg): Spell out the word "argument."
{
/* { name, min_len, max_len, decl_req, type_req, fn_type_req,
affects_type_identity, handler, exclude } */
- { "omp declare target", 0, 0, true, false, false, false,
+ { "omp declare target", 0, -1, true, false, false, false,
gfc_handle_omp_declare_target_attribute, NULL },
{ "omp declare target link", 0, 0, true, false, false, false,
gfc_handle_omp_declare_target_attribute, NULL },
list = chainon (list, attr);
}
- if (sym_attr.omp_declare_target_link)
- list = tree_cons (get_identifier ("omp declare target link"),
- NULL_TREE, list);
- else if (sym_attr.omp_declare_target)
- list = tree_cons (get_identifier ("omp declare target"),
- NULL_TREE, list);
+ tree clauses = NULL_TREE;
if (sym_attr.oacc_routine_lop != OACC_ROUTINE_LOP_NONE)
{
gcc_unreachable ();
}
tree c = build_omp_clause (UNKNOWN_LOCATION, code);
+ OMP_CLAUSE_CHAIN (c) = clauses;
+ clauses = c;
- tree dims = oacc_build_routine_dims (c);
+ tree dims = oacc_build_routine_dims (clauses);
list = oacc_replace_fn_attrib_attr (list, dims);
}
+ if (sym_attr.omp_declare_target_link)
+ list = tree_cons (get_identifier ("omp declare target link"),
+ NULL_TREE, list);
+ else if (sym_attr.omp_declare_target)
+ list = tree_cons (get_identifier ("omp declare target"),
+ clauses, list);
+
return list;
}
+2019-05-17 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR testsuite/89433
+ * c-c++-common/goacc/classify-routine.c: Update.
+ * gfortran.dg/goacc/classify-routine.f95: Likewise.
+
2019-05-16 Martin Sebor <msebor@redhat.com>
* c-c++-common/Wbool-operation-1.c: Adjust text of expected diagnostics.
}
/* Check the offloaded function's attributes.
- { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(omp declare target, oacc function \\(0 1, 1 0, 1 0\\)\\)\\)" 1 "ompexp" } } */
+ { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(omp declare target \\(worker\\), oacc function \\(0 1, 1 0, 1 0\\)\\)\\)" 1 "ompexp" } } */
/* Check the offloaded function's classification and compute dimensions (will
always be 1 x 1 x 1 for non-offloading compilation).
{ dg-final { scan-tree-dump-times "(?n)Function is OpenACC routine level 1" 1 "oaccdevlow" } }
{ dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccdevlow" } }
- { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(0 1, 1 1, 1 1\\), omp declare target, oacc function \\(0 1, 1 0, 1 0\\)\\)\\)" 1 "oaccdevlow" } } */
+ { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(0 1, 1 1, 1 1\\), omp declare target \\(worker\\), oacc function \\(0 1, 1 0, 1 0\\)\\)\\)" 1 "oaccdevlow" } } */
end subroutine ROUTINE
! Check the offloaded function's attributes.
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(omp declare target, oacc function \\(0 1, 1 0, 1 0\\)\\)\\)" 1 "ompexp" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(0 1, 1 0, 1 0\\), omp declare target \\(worker\\)\\)\\)" 1 "ompexp" } }
! Check the offloaded function's classification and compute dimensions (will
! always be 1 x 1 x 1 for non-offloading compilation).
! { dg-final { scan-tree-dump-times "(?n)Function is OpenACC routine level 1" 1 "oaccdevlow" } }
! { dg-final { scan-tree-dump-times "(?n)Compute dimensions \\\[1, 1, 1\\\]" 1 "oaccdevlow" } }
-! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(0 1, 1 1, 1 1\\), omp declare target, oacc function \\(0 1, 1 0, 1 0\\)\\)\\)" 1 "oaccdevlow" } }
+! { dg-final { scan-tree-dump-times "(?n)__attribute__\\(\\(oacc function \\(0 1, 1 1, 1 1\\), omp declare target \\(worker\\)\\)\\)" 1 "oaccdevlow" } }