@@ -570,8 +570,6 @@ const struct attribute_spec c_common_gnu_attributes[] =
handle_omp_declare_target_attribute, NULL },
{ "omp declare target nohost", 0, 0, true, false, false, false,
handle_omp_declare_target_attribute, NULL },
- { "omp declare target block", 0, 0, true, false, false, false,
- handle_omp_declare_target_attribute, NULL },
{ "non overlapping", 0, 0, true, false, false, false,
handle_non_overlapping_attribute, NULL },
{ "alloc_align", 1, 1, false, true, true, false,
@@ -5414,12 +5414,8 @@ c_decl_attributes (tree *node, tree attributes, int flags)
attributes = tree_cons (get_identifier ("omp declare target implicit"),
NULL_TREE, attributes);
else
- {
- attributes = tree_cons (get_identifier ("omp declare target"),
- NULL_TREE, attributes);
- attributes = tree_cons (get_identifier ("omp declare target block"),
- NULL_TREE, attributes);
- }
+ attributes = tree_cons (get_identifier ("omp declare target"),
+ NULL_TREE, attributes);
if (TREE_CODE (*node) == FUNCTION_DECL)
{
int device_type
@@ -1777,13 +1777,8 @@ cplus_decl_attributes (tree *decl, tree attributes, int flags)
= tree_cons (get_identifier ("omp declare target implicit"),
NULL_TREE, attributes);
else
- {
- attributes = tree_cons (get_identifier ("omp declare target"),
- NULL_TREE, attributes);
- attributes
- = tree_cons (get_identifier ("omp declare target block"),
- NULL_TREE, attributes);
- }
+ attributes = tree_cons (get_identifier ("omp declare target"),
+ NULL_TREE, attributes);
if (TREE_CODE (*decl) == FUNCTION_DECL)
{
cp_omp_declare_target_attr &last
@@ -2609,7 +2609,7 @@ omp_complete_construct_context (tree construct_context, bool *completep)
}
/* Add target trait when in a target variant. */
- if (lookup_attribute ("omp declare target block", attributes))
+ if (lookup_attribute ("omp declare target", attributes))
construct_context = make_trait_selector (OMP_TRAIT_CONSTRUCT_TARGET,
NULL_TREE, NULL_TREE,
construct_context);
@@ -4,12 +4,12 @@
#pragma omp begin declare target indirect
void fn1 (void) { }
#pragma omp end declare target
-/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target block, omp declare target indirect\\\)\\\)\\\nvoid fn1" "gimple" } } */
+/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target indirect\\\)\\\)\\\nvoid fn1" "gimple" } } */
#pragma omp begin declare target indirect (0)
void fn2 (void) { }
#pragma omp end declare target
-/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target block\\\)\\\)\\\nvoid fn2" "gimple" } } */
+/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target\\\)\\\)\\\nvoid fn2" "gimple" } } */
void fn3 (void) { }
#pragma omp declare target indirect to (fn3)
@@ -27,6 +27,6 @@ void fn4 (void) { }
#pragma omp declare target indirect enter(baz)
#pragma omp end declare target
#pragma omp end declare target
-/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target block, omp declare target indirect\\\)\\\)\\\nint foo" "gimple" } } */
-/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target block\\\)\\\)\\\nint bar" "gimple" } } */
-/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target indirect, omp declare target, omp declare target block\\\)\\\)\\\nint baz" "gimple" } } */
+/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target, omp declare target indirect\\\)\\\)\\\nint foo" "gimple" } } */
+/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target\\\)\\\)\\\nint bar" "gimple" } } */
+/* { dg-final { scan-tree-dump "__attribute__\\\(\\\(omp declare target indirect, omp declare target\\\)\\\)\\\nint baz" "gimple" } } */
@@ -1,4 +1,4 @@
-/* { dg-do compile { target c } } */
+/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-gimple" } */
void f01 (void);
@@ -102,7 +102,7 @@ void
test3 (void)
{
#pragma omp parallel
- f20 (); /* { dg-final { scan-tree-dump-times "f20 \\\(\\\);" 1 "gimple" } } */
+ f20 (); /* { dg-final { scan-tree-dump-times "f19 \\\(\\\);" 1 "gimple" } } */
}
void
@@ -4,7 +4,7 @@
/* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*int called_in_target1" 1 "omplower" } } */
/* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*int called_in_target2" 1 "omplower" } } */
-/* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target, omp declare target block\\)\\)\[\n\r\]*void tg_fn" 1 "omplower" } } */
+/* { dg-final { scan-tree-dump-times "__attribute__\\(\\(omp declare target\\)\\)\[\n\r\]*void tg_fn" 1 "omplower" } } */
/* { dg-prune-output "'reverse_offload' clause on 'requires' directive not supported yet" } */
@@ -167,23 +167,15 @@ contains
end subroutine
subroutine test2 ()
- ! OpenMP 5.0 specifies that the 'target' trait should be added for
- ! functions within a declare target block, but Fortran does not have
- ! the notion of a declare target _block_, so the variant is not used here.
- ! This may change in later versions of OpenMP.
-
!$omp declare target
!$omp parallel
- call f18 () ! { dg-final { scan-tree-dump-times "f18 \\\(\\\);" 1 "gimple" } }
+ call f18 () ! { dg-final { scan-tree-dump-times "f17 \\\(\\\);" 1 "gimple" } }
!$omp end parallel
end subroutine
subroutine test3 ()
- ! In the C version, this test was used to check that the
- ! 'declare target to' form of the directive did not result in the variant
- ! being used.
!$omp parallel
- call f20 () ! { dg-final { scan-tree-dump-times "f20 \\\(\\\);" 1 "gimple" } }
+ call f20 () ! { dg-final { scan-tree-dump-times "f19 \\\(\\\);" 1 "gimple" } }
!$omp end parallel
end subroutine