Index: c/c-typeck.c =================================================================== --- c/c-typeck.c (revision 236845) +++ c/c-typeck.c (working copy) @@ -12529,6 +12529,7 @@ c_finish_omp_clauses (tree clauses, enum c_omp_reg tree *nowait_clause = NULL; bool ordered_seen = false; tree schedule_clause = NULL_TREE; + bool oacc_async = false; bitmap_obstack_initialize (NULL); bitmap_initialize (&generic_head, &bitmap_default_obstack); @@ -12539,6 +12540,14 @@ c_finish_omp_clauses (tree clauses, enum c_omp_reg bitmap_initialize (&map_field_head, &bitmap_default_obstack); bitmap_initialize (&oacc_reduction_head, &bitmap_default_obstack); + if (ort & C_ORT_ACC) + for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ASYNC) + { + oacc_async = true; + break; + } + for (pc = &clauses, c = clauses; c ; c = *pc) { bool remove = false; @@ -12575,6 +12584,8 @@ c_finish_omp_clauses (tree clauses, enum c_omp_reg remove = true; break; } + if (oacc_async) + c_mark_addressable (t); type = TREE_TYPE (t); if (TREE_CODE (t) == MEM_REF) type = TREE_TYPE (type); Index: cp/semantics.c =================================================================== --- cp/semantics.c (revision 236845) +++ cp/semantics.c (working copy) @@ -5774,6 +5774,7 @@ finish_omp_clauses (tree clauses, enum c_omp_regio bool branch_seen = false; bool copyprivate_seen = false; bool ordered_seen = false; + bool oacc_async = false; bitmap_obstack_initialize (NULL); bitmap_initialize (&generic_head, &bitmap_default_obstack); @@ -5784,6 +5785,14 @@ finish_omp_clauses (tree clauses, enum c_omp_regio bitmap_initialize (&map_field_head, &bitmap_default_obstack); bitmap_initialize (&oacc_reduction_head, &bitmap_default_obstack); + if (ort & C_ORT_ACC) + for (c = clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ASYNC) + { + oacc_async = true; + break; + } + for (pc = &clauses, c = clauses; c ; c = *pc) { bool remove = false; @@ -5827,6 +5836,8 @@ finish_omp_clauses (tree clauses, enum c_omp_regio t = n; goto check_dup_generic_t; } + if (oacc_async) + cxx_mark_addressable (t); goto check_dup_generic; case OMP_CLAUSE_COPYPRIVATE: copyprivate_seen = true; Index: fortran/trans-openmp.c =================================================================== --- fortran/trans-openmp.c (revision 236845) +++ fortran/trans-openmp.c (working copy) @@ -2704,6 +2704,15 @@ gfc_trans_oacc_construct (gfc_code *code) gfc_start_block (&block); oacc_clauses = gfc_trans_omp_clauses (&block, code->ext.omp_clauses, code->loc); + for (tree c = oacc_clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ASYNC) + { + for (c = oacc_clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION + && DECL_P (OMP_CLAUSE_DECL (c))) + TREE_ADDRESSABLE (OMP_CLAUSE_DECL (c)) = 1; + break; + } stmt = gfc_trans_omp_code (code->block->next, true); stmt = build2_loc (input_location, construct_code, void_type_node, stmt, oacc_clauses); @@ -3501,6 +3510,15 @@ gfc_trans_oacc_combined_directive (gfc_code *code) construct_clauses.lists[OMP_LIST_REDUCTION] = NULL; oacc_clauses = gfc_trans_omp_clauses (&block, &construct_clauses, code->loc); + for (tree c = oacc_clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_ASYNC) + { + for (c = oacc_clauses; c; c = OMP_CLAUSE_CHAIN (c)) + if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_REDUCTION + && DECL_P (OMP_CLAUSE_DECL (c))) + TREE_ADDRESSABLE (OMP_CLAUSE_DECL (c)) = 1; + break; + } } if (!loop_clauses.seq) pblock = █