diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2021-09-13 19:49:49 +0200 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2021-09-13 19:49:49 +0200 |
commit | b18a97e5dd0935e1c4a626c230f21457d0aad3d5 (patch) | |
tree | c1818f41af6fe780deafb6cd6a183f32085fe654 /gcc/tree-nested.c | |
parent | e76a53644c9d70e998c0d050e9a456af388c6b61 (diff) | |
download | gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.zip gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.tar.gz gcc-b18a97e5dd0935e1c4a626c230f21457d0aad3d5.tar.bz2 |
Merged current trunk to branch.
Diffstat (limited to 'gcc/tree-nested.c')
-rw-r--r-- | gcc/tree-nested.c | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c index a4d82174..c7f50eb 100644 --- a/gcc/tree-nested.c +++ b/gcc/tree-nested.c @@ -1,5 +1,5 @@ /* Nested function decomposition for GIMPLE. - Copyright (C) 2004-2020 Free Software Foundation, Inc. + Copyright (C) 2004-2021 Free Software Foundation, Inc. This file is part of GCC. @@ -411,8 +411,8 @@ lookup_field_for_decl (struct nesting_info *info, tree decl, DECL_USER_ALIGN (field) = DECL_USER_ALIGN (decl); DECL_IGNORED_P (field) = DECL_IGNORED_P (decl); DECL_NONADDRESSABLE_P (field) = !TREE_ADDRESSABLE (decl); - TREE_NO_WARNING (field) = TREE_NO_WARNING (decl); TREE_THIS_VOLATILE (field) = TREE_THIS_VOLATILE (decl); + copy_warning (field, decl); /* Declare the transformation and adjust the original DECL. For a variable or for a parameter when not optimizing, we make it point @@ -1033,6 +1033,7 @@ get_frame_field (struct nesting_info *info, tree target_context, } x = build3 (COMPONENT_REF, TREE_TYPE (field), x, field, NULL_TREE); + TREE_THIS_VOLATILE (x) = TREE_THIS_VOLATILE (field); return x; } @@ -1214,7 +1215,6 @@ convert_nonlocal_reference_op (tree *tp, int *walk_subtrees, void *data) save_context = current_function_decl; current_function_decl = info->context; recompute_tree_invariant_for_addr_expr (t); - current_function_decl = save_context; /* If the callback converted the address argument in a context where we only accept variables (and min_invariant, presumably), @@ -1222,6 +1222,7 @@ convert_nonlocal_reference_op (tree *tp, int *walk_subtrees, void *data) if (save_val_only) *tp = gsi_gimplify_val ((struct nesting_info *) wi->info, t, &wi->gsi); + current_function_decl = save_context; } } break; @@ -1339,6 +1340,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_USE_DEVICE_PTR: case OMP_CLAUSE_USE_DEVICE_ADDR: case OMP_CLAUSE_IS_DEVICE_PTR: + case OMP_CLAUSE_DETACH: do_decl_clause: if (pdecl == NULL) pdecl = &OMP_CLAUSE_DECL (clause); @@ -1374,6 +1376,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_GRAINSIZE: case OMP_CLAUSE_NUM_TASKS: case OMP_CLAUSE_HINT: + case OMP_CLAUSE_FILTER: case OMP_CLAUSE_NUM_GANGS: case OMP_CLAUSE_NUM_WORKERS: case OMP_CLAUSE_VECTOR_LENGTH: @@ -1483,6 +1486,7 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_AUTO: case OMP_CLAUSE_IF_PRESENT: case OMP_CLAUSE_FINALIZE: + case OMP_CLAUSE_BIND: case OMP_CLAUSE__CONDTEMP_: case OMP_CLAUSE__SCANTEMP_: break; @@ -1508,6 +1512,9 @@ convert_nonlocal_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE__REDUCTEMP_: case OMP_CLAUSE__SIMDUID_: case OMP_CLAUSE__SIMT_: + /* The following clauses are only allowed on OpenACC 'routine' + directives, not seen here. */ + case OMP_CLAUSE_NOHOST: /* Anything else. */ default: gcc_unreachable (); @@ -1729,6 +1736,14 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, info->suppress_expansion = save_suppress; break; + case GIMPLE_OMP_SCOPE: + save_suppress = info->suppress_expansion; + convert_nonlocal_omp_clauses (gimple_omp_scope_clauses_ptr (stmt), wi); + walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op, + info, gimple_omp_body_ptr (stmt)); + info->suppress_expansion = save_suppress; + break; + case GIMPLE_OMP_TASKGROUP: save_suppress = info->suppress_expansion; convert_nonlocal_omp_clauses (gimple_omp_taskgroup_clauses_ptr (stmt), wi); @@ -1779,6 +1794,7 @@ convert_nonlocal_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, case GIMPLE_OMP_SECTION: case GIMPLE_OMP_MASTER: + case GIMPLE_OMP_MASKED: case GIMPLE_OMP_ORDERED: case GIMPLE_OMP_SCAN: walk_body (convert_nonlocal_reference_stmt, convert_nonlocal_reference_op, @@ -1968,13 +1984,13 @@ convert_local_reference_op (tree *tp, int *walk_subtrees, void *data) save_context = current_function_decl; current_function_decl = info->context; recompute_tree_invariant_for_addr_expr (t); - current_function_decl = save_context; /* If we are in a context where we only accept values, then compute the address into a temporary. */ if (save_val_only) *tp = gsi_gimplify_val ((struct nesting_info *) wi->info, t, &wi->gsi); + current_function_decl = save_context; } break; @@ -2108,6 +2124,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_USE_DEVICE_PTR: case OMP_CLAUSE_USE_DEVICE_ADDR: case OMP_CLAUSE_IS_DEVICE_PTR: + case OMP_CLAUSE_DETACH: do_decl_clause: if (pdecl == NULL) pdecl = &OMP_CLAUSE_DECL (clause); @@ -2147,6 +2164,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_GRAINSIZE: case OMP_CLAUSE_NUM_TASKS: case OMP_CLAUSE_HINT: + case OMP_CLAUSE_FILTER: case OMP_CLAUSE_NUM_GANGS: case OMP_CLAUSE_NUM_WORKERS: case OMP_CLAUSE_VECTOR_LENGTH: @@ -2262,6 +2280,7 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE_AUTO: case OMP_CLAUSE_IF_PRESENT: case OMP_CLAUSE_FINALIZE: + case OMP_CLAUSE_BIND: case OMP_CLAUSE__CONDTEMP_: case OMP_CLAUSE__SCANTEMP_: break; @@ -2287,6 +2306,9 @@ convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi) case OMP_CLAUSE__REDUCTEMP_: case OMP_CLAUSE__SIMDUID_: case OMP_CLAUSE__SIMT_: + /* The following clauses are only allowed on OpenACC 'routine' + directives, not seen here. */ + case OMP_CLAUSE_NOHOST: /* Anything else. */ default: gcc_unreachable (); @@ -2444,6 +2466,14 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, info->suppress_expansion = save_suppress; break; + case GIMPLE_OMP_SCOPE: + save_suppress = info->suppress_expansion; + convert_local_omp_clauses (gimple_omp_scope_clauses_ptr (stmt), wi); + walk_body (convert_local_reference_stmt, convert_local_reference_op, + info, gimple_omp_body_ptr (stmt)); + info->suppress_expansion = save_suppress; + break; + case GIMPLE_OMP_TASKGROUP: save_suppress = info->suppress_expansion; convert_local_omp_clauses (gimple_omp_taskgroup_clauses_ptr (stmt), wi); @@ -2507,6 +2537,7 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, case GIMPLE_OMP_SECTION: case GIMPLE_OMP_MASTER: + case GIMPLE_OMP_MASKED: case GIMPLE_OMP_ORDERED: case GIMPLE_OMP_SCAN: walk_body (convert_local_reference_stmt, convert_local_reference_op, @@ -2524,6 +2555,7 @@ convert_local_reference_stmt (gimple_stmt_iterator *gsi, bool *handled_ops_p, { tree lhs = gimple_assign_lhs (stmt); if (DECL_P (lhs) + && decl_function_context (lhs) == info->context && !use_pointer_in_frame (lhs) && lookup_field_for_decl (info, lhs, NO_INSERT)) { @@ -3015,7 +3047,9 @@ convert_gimple_call (gimple_stmt_iterator *gsi, bool *handled_ops_p, case GIMPLE_OMP_SECTIONS: case GIMPLE_OMP_SECTION: case GIMPLE_OMP_SINGLE: + case GIMPLE_OMP_SCOPE: case GIMPLE_OMP_MASTER: + case GIMPLE_OMP_MASKED: case GIMPLE_OMP_TASKGROUP: case GIMPLE_OMP_ORDERED: case GIMPLE_OMP_SCAN: |