diff options
author | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2021-09-13 10:37:49 -0700 |
commit | e252b51ccde010cbd2a146485d8045103cd99533 (patch) | |
tree | e060f101cdc32bf5e520de8e5275db9d4236b74c /gcc/gimple.c | |
parent | f10c7c4596dda99d2ee872c995ae4aeda65adbdf (diff) | |
parent | 104c05c5284b7822d770ee51a7d91946c7e56d50 (diff) | |
download | gcc-e252b51ccde010cbd2a146485d8045103cd99533.zip gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.gz gcc-e252b51ccde010cbd2a146485d8045103cd99533.tar.bz2 |
Merge from trunk revision 104c05c5284b7822d770ee51a7d91946c7e56d50.
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r-- | gcc/gimple.c | 78 |
1 files changed, 62 insertions, 16 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c index 87864f3..bed7ff9 100644 --- a/gcc/gimple.c +++ b/gcc/gimple.c @@ -48,7 +48,7 @@ along with GCC; see the file COPYING3. If not see #include "attr-fnspec.h" #include "ipa-modref-tree.h" #include "ipa-modref.h" - +#include "dbgcnt.h" /* All the tuples have their operand vector (if present) at the very bottom of the structure. Therefore, the offset required to find the @@ -241,7 +241,7 @@ gimple_build_call_1 (tree fn, unsigned nargs) specified in vector ARGS. */ gcall * -gimple_build_call_vec (tree fn, vec<tree> args) +gimple_build_call_vec (tree fn, const vec<tree> &args) { unsigned i; unsigned nargs = args.length (); @@ -338,7 +338,7 @@ gimple_build_call_internal (enum internal_fn fn, unsigned nargs, ...) specified in vector ARGS. */ gcall * -gimple_build_call_internal_vec (enum internal_fn fn, vec<tree> args) +gimple_build_call_internal_vec (enum internal_fn fn, const vec<tree> &args) { unsigned i, nargs; gcall *call; @@ -399,7 +399,7 @@ gimple_build_call_from_tree (tree t, tree fnptrtype) gimple_call_set_va_arg_pack (call, CALL_EXPR_VA_ARG_PACK (t)); gimple_call_set_nothrow (call, TREE_NOTHROW (t)); gimple_call_set_by_descriptor (call, CALL_EXPR_BY_DESCRIPTOR (t)); - gimple_set_no_warning (call, TREE_NO_WARNING (t)); + copy_warning (call, t); if (fnptrtype) { @@ -802,7 +802,7 @@ gimple_build_switch_nlabels (unsigned nlabels, tree index, tree default_label) ARGS is a vector of labels excluding the default. */ gswitch * -gimple_build_switch (tree index, tree default_label, vec<tree> args) +gimple_build_switch (tree index, tree default_label, const vec<tree> &args) { unsigned i, nlabels = args.length (); @@ -1038,6 +1038,21 @@ gimple_build_omp_master (gimple_seq body) return p; } +/* Build a GIMPLE_OMP_MASKED statement. + + BODY is the sequence of statements to be executed by the selected thread(s). */ + +gimple * +gimple_build_omp_masked (gimple_seq body, tree clauses) +{ + gimple *p = gimple_alloc (GIMPLE_OMP_MASKED, 0); + gimple_omp_masked_set_clauses (p, clauses); + if (body) + gimple_omp_set_body (p, body); + + return p; +} + /* Build a GIMPLE_OMP_TASKGROUP statement. BODY is the sequence of statements to be executed by the taskgroup @@ -1170,6 +1185,24 @@ gimple_build_omp_single (gimple_seq body, tree clauses) } +/* Build a GIMPLE_OMP_SCOPE statement. + + BODY is the sequence of statements that will be executed once. + CLAUSES are any of the OMP scope construct's clauses: private, reduction, + nowait. */ + +gimple * +gimple_build_omp_scope (gimple_seq body, tree clauses) +{ + gimple *p = gimple_alloc (GIMPLE_OMP_SCOPE, 0); + gimple_omp_scope_set_clauses (p, clauses); + if (body) + gimple_omp_set_body (p, body); + + return p; +} + + /* Build a GIMPLE_OMP_TARGET statement. BODY is the sequence of statements that will be executed. @@ -1568,7 +1601,8 @@ gimple_call_arg_flags (const gcall *stmt, unsigned arg) if ((modref_flags & EAF_DIRECT) && !(flags & EAF_DIRECT)) modref_flags &= ~EAF_DIRECT; } - flags |= modref_flags; + if (dbg_cnt (ipa_mod_ref_pta)) + flags |= modref_flags; } } return flags; @@ -2005,6 +2039,11 @@ gimple_copy (gimple *stmt) } goto copy_omp_body; + case GIMPLE_OMP_SCOPE: + t = unshare_expr (gimple_omp_scope_clauses (stmt)); + gimple_omp_scope_set_clauses (copy, t); + goto copy_omp_body; + case GIMPLE_OMP_TARGET: { gomp_target *omp_target_stmt = as_a <gomp_target *> (stmt); @@ -2031,6 +2070,11 @@ gimple_copy (gimple *stmt) gimple_omp_set_body (copy, new_seq); break; + case GIMPLE_OMP_MASKED: + t = unshare_expr (gimple_omp_masked_clauses (stmt)); + gimple_omp_masked_set_clauses (copy, t); + goto copy_omp_body; + case GIMPLE_TRANSACTION: new_seq = gimple_seq_copy (gimple_transaction_body ( as_a <gtransaction *> (stmt))); @@ -2129,7 +2173,7 @@ gimple_has_side_effects (const gimple *s) S is a GIMPLE_ASSIGN, the LHS of the assignment is also checked. */ bool -gimple_could_trap_p_1 (gimple *s, bool include_mem, bool include_stores) +gimple_could_trap_p_1 (const gimple *s, bool include_mem, bool include_stores) { tree t, div = NULL_TREE; enum tree_code op; @@ -2146,11 +2190,13 @@ gimple_could_trap_p_1 (gimple *s, bool include_mem, bool include_stores) switch (gimple_code (s)) { case GIMPLE_ASM: - return gimple_asm_volatile_p (as_a <gasm *> (s)); + return gimple_asm_volatile_p (as_a <const gasm *> (s)); case GIMPLE_CALL: + if (gimple_call_internal_p (s)) + return false; t = gimple_call_fndecl (s); - /* Assume that calls to weak functions may trap. */ + /* Assume that indirect and calls to weak functions may trap. */ if (!t || !DECL_P (t) || DECL_WEAK (t)) return true; return false; @@ -2158,16 +2204,16 @@ gimple_could_trap_p_1 (gimple *s, bool include_mem, bool include_stores) case GIMPLE_ASSIGN: op = gimple_assign_rhs_code (s); - /* For COND_EXPR and VEC_COND_EXPR only the condition may trap. */ - if (op == COND_EXPR || op == VEC_COND_EXPR) + /* For COND_EXPR only the condition may trap. */ + if (op == COND_EXPR) return tree_could_trap_p (gimple_assign_rhs1 (s)); - /* For comparisons we need to check rhs operand types instead of rhs type + /* For comparisons we need to check rhs operand types instead of lhs type (which is BOOLEAN_TYPE). */ if (TREE_CODE_CLASS (op) == tcc_comparison) t = TREE_TYPE (gimple_assign_rhs1 (s)); else - t = gimple_expr_type (s); + t = TREE_TYPE (gimple_assign_lhs (s)); if (get_gimple_rhs_class (op) == GIMPLE_BINARY_RHS) div = gimple_assign_rhs2 (s); @@ -2192,7 +2238,7 @@ gimple_could_trap_p_1 (gimple *s, bool include_mem, bool include_stores) /* Return true if statement S can trap. */ bool -gimple_could_trap_p (gimple *s) +gimple_could_trap_p (const gimple *s) { return gimple_could_trap_p_1 (s, true, true); } @@ -3049,7 +3095,7 @@ compare_case_labels (const void *p1, const void *p2) /* Sort the case labels in LABEL_VEC in place in ascending order. */ void -sort_case_labels (vec<tree> label_vec) +sort_case_labels (vec<tree> &label_vec) { label_vec.qsort (compare_case_labels); } @@ -3074,7 +3120,7 @@ sort_case_labels (vec<tree> label_vec) found or not. */ void -preprocess_case_label_vec_for_gimple (vec<tree> labels, +preprocess_case_label_vec_for_gimple (vec<tree> &labels, tree index_type, tree *default_casep) { |