From 25b45c7c6cea24f85d2f87c11c0e3c99ef20b655 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 26 Sep 2019 22:03:12 +0200 Subject: [PATCH] function.c (gimplify_parameters): Use build_clobber function. * function.c (gimplify_parameters): Use build_clobber function. * tree-ssa.c (execute_update_addresses_taken): Likewise. * tree-inline.c (expand_call_inline): Likewise. * tree-sra.c (clobber_subtree): Likewise. * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Likewise. * omp-low.c (lower_rec_simd_input_clauses, lower_rec_input_clauses, lower_omp_single, lower_depend_clauses, lower_omp_taskreg, lower_omp_target): Likewise. * omp-expand.c (expand_omp_for_generic): Likewise. * omp-offload.c (ompdevlow_adjust_simt_enter): Likewise. From-SVN: r276165 --- gcc/ChangeLog | 13 +++++++++++++ gcc/function.c | 3 +-- gcc/omp-expand.c | 6 ++---- gcc/omp-low.c | 22 +++++++--------------- gcc/omp-offload.c | 3 +-- gcc/tree-inline.c | 9 +++------ gcc/tree-sra.c | 3 +-- gcc/tree-ssa-ccp.c | 4 +--- gcc/tree-ssa.c | 4 +--- 9 files changed, 30 insertions(+), 37 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c4cd4ac9f46..416bf6386b7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2019-09-26 Jakub Jelinek + + * function.c (gimplify_parameters): Use build_clobber function. + * tree-ssa.c (execute_update_addresses_taken): Likewise. + * tree-inline.c (expand_call_inline): Likewise. + * tree-sra.c (clobber_subtree): Likewise. + * tree-ssa-ccp.c (insert_clobber_before_stack_restore): Likewise. + * omp-low.c (lower_rec_simd_input_clauses, lower_rec_input_clauses, + lower_omp_single, lower_depend_clauses, lower_omp_taskreg, + lower_omp_target): Likewise. + * omp-expand.c (expand_omp_for_generic): Likewise. + * omp-offload.c (ompdevlow_adjust_simt_enter): Likewise. + 2019-09-26 Will Schmidt * config/rs6000/rs6000-builtin.def: (LVSL, LVSR, LVEBX, LVEHX, diff --git a/gcc/function.c b/gcc/function.c index e60b6fa46a9..9c158cec121 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -3892,9 +3892,8 @@ gimplify_parameters (gimple_seq *cleanup) if (!is_gimple_reg (local) && flag_stack_reuse != SR_NONE) { - tree clobber = build_constructor (type, NULL); + tree clobber = build_clobber (type); gimple *clobber_stmt; - TREE_THIS_VOLATILE (clobber) = 1; clobber_stmt = gimple_build_assign (local, clobber); gimple_seq_add_stmt (cleanup, clobber_stmt); } diff --git a/gcc/omp-expand.c b/gcc/omp-expand.c index 94543de6203..0f703bede47 100644 --- a/gcc/omp-expand.c +++ b/gcc/omp-expand.c @@ -2988,8 +2988,7 @@ expand_omp_for_generic (struct omp_region *region, true, GSI_SAME_STMT); if (arr && !TREE_STATIC (arr)) { - tree clobber = build_constructor (TREE_TYPE (arr), NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (TREE_TYPE (arr)); gsi_insert_before (&gsi, gimple_build_assign (arr, clobber), GSI_SAME_STMT); } @@ -3356,8 +3355,7 @@ expand_omp_for_generic (struct omp_region *region, if (fd->ordered) { tree arr = counts[fd->ordered]; - tree clobber = build_constructor (TREE_TYPE (arr), NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (TREE_TYPE (arr)); gsi_insert_after (&gsi, gimple_build_assign (arr, clobber), GSI_SAME_STMT); } diff --git a/gcc/omp-low.c b/gcc/omp-low.c index 444610b0096..5db182c6841 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -4044,8 +4044,7 @@ lower_rec_simd_input_clauses (tree new_var, omp_context *ctx, DECL_ATTRIBUTES (ivar) = tree_cons (get_identifier ("omp simt private"), NULL, DECL_ATTRIBUTES (ivar)); sctx->simt_eargs.safe_push (build1 (ADDR_EXPR, ptype, ivar)); - tree clobber = build_constructor (type, NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (type); gimple *g = gimple_build_assign (ivar, clobber); gimple_seq_add_stmt (&sctx->simt_dlist, g); } @@ -5939,8 +5938,7 @@ lower_rec_input_clauses (tree clauses, gimple_seq *ilist, gimple_seq *dlist, } if (tskred_avar) { - tree clobber = build_constructor (TREE_TYPE (tskred_avar), NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (TREE_TYPE (tskred_avar)); gimple_seq_add_stmt (ilist, gimple_build_assign (tskred_avar, clobber)); } @@ -7896,8 +7894,7 @@ lower_omp_single (gimple_stmt_iterator *gsi_p, omp_context *ctx) if (ctx->record_type) { gimple_stmt_iterator gsi = gsi_start (bind_body_tail); - tree clobber = build_constructor (ctx->record_type, NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (ctx->record_type); gsi_insert_after (&gsi, gimple_build_assign (ctx->sender_decl, clobber), GSI_SAME_STMT); } @@ -11029,8 +11026,7 @@ lower_depend_clauses (tree *pclauses, gimple_seq *iseq, gimple_seq *oseq) OMP_CLAUSE_DECL (c) = build_fold_addr_expr (array); OMP_CLAUSE_CHAIN (c) = *pclauses; *pclauses = c; - tree clobber = build_constructor (type, NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (type); g = gimple_build_assign (array, clobber); gimple_seq_add_stmt (oseq, g); } @@ -11165,8 +11161,7 @@ lower_omp_taskreg (gimple_stmt_iterator *gsi_p, omp_context *ctx) if (ctx->record_type) { - tree clobber = build_constructor (TREE_TYPE (ctx->sender_decl), NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (TREE_TYPE (ctx->sender_decl)); gimple_seq_add_stmt (&olist, gimple_build_assign (ctx->sender_decl, clobber)); } @@ -11911,16 +11906,13 @@ lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx) &initlist, true, NULL_TREE); gimple_seq_add_seq (&ilist, initlist); - tree clobber = build_constructor (TREE_TYPE (TREE_VEC_ELT (t, i)), - NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (TREE_TYPE (TREE_VEC_ELT (t, i))); gimple_seq_add_stmt (&olist, gimple_build_assign (TREE_VEC_ELT (t, i), clobber)); } - tree clobber = build_constructor (ctx->record_type, NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (ctx->record_type); gimple_seq_add_stmt (&olist, gimple_build_assign (ctx->sender_decl, clobber)); } diff --git a/gcc/omp-offload.c b/gcc/omp-offload.c index da788d9f514..32eacf7863e 100644 --- a/gcc/omp-offload.c +++ b/gcc/omp-offload.c @@ -1855,8 +1855,7 @@ ompdevlow_adjust_simt_enter (gimple_stmt_iterator *gsi, bool *regimplify) { gcc_assert (gimple_call_internal_p (exit_stmt, IFN_GOMP_SIMT_EXIT)); gimple_stmt_iterator exit_gsi = gsi_for_stmt (exit_stmt); - tree clobber = build_constructor (rectype, NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (rectype); exit_stmt = gimple_build_assign (build_simple_mem_ref (simtrec), clobber); gsi_insert_before (&exit_gsi, exit_stmt, GSI_SAME_STMT); } diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index e4ae1b058fd..500037c9f3f 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -5016,9 +5016,8 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) tree *varp = id->decl_map->get (p); if (varp && VAR_P (*varp) && !is_gimple_reg (*varp)) { - tree clobber = build_constructor (TREE_TYPE (*varp), NULL); + tree clobber = build_clobber (TREE_TYPE (*varp)); gimple *clobber_stmt; - TREE_THIS_VOLATILE (clobber) = 1; clobber_stmt = gimple_build_assign (*varp, clobber); gimple_set_location (clobber_stmt, gimple_location (stmt)); gsi_insert_before (&stmt_gsi, clobber_stmt, GSI_SAME_STMT); @@ -5086,9 +5085,8 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) && !is_gimple_reg (id->retvar) && !stmt_ends_bb_p (stmt)) { - tree clobber = build_constructor (TREE_TYPE (id->retvar), NULL); + tree clobber = build_clobber (TREE_TYPE (id->retvar)); gimple *clobber_stmt; - TREE_THIS_VOLATILE (clobber) = 1; clobber_stmt = gimple_build_assign (id->retvar, clobber); gimple_set_location (clobber_stmt, gimple_location (old_stmt)); gsi_insert_after (&stmt_gsi, clobber_stmt, GSI_SAME_STMT); @@ -5134,9 +5132,8 @@ expand_call_inline (basic_block bb, gimple *stmt, copy_body_data *id) && !TREE_THIS_VOLATILE (id->retvar) && !is_gimple_reg (id->retvar)) { - tree clobber = build_constructor (TREE_TYPE (id->retvar), NULL); + tree clobber = build_clobber (TREE_TYPE (id->retvar)); gimple *clobber_stmt; - TREE_THIS_VOLATILE (clobber) = 1; clobber_stmt = gimple_build_assign (id->retvar, clobber); gimple_set_location (clobber_stmt, gimple_location (stmt)); gsi_replace (&stmt_gsi, clobber_stmt, false); diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index ba6d5406587..c462ca46e7d 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -3028,8 +3028,7 @@ clobber_subtree (struct access *access, gimple_stmt_iterator *gsi, if (access->grp_to_be_replaced) { tree rep = get_access_replacement (access); - tree clobber = build_constructor (access->type, NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (access->type); gimple *stmt = gimple_build_assign (rep, clobber); if (insert_after) diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 311918bfaf7..a8d0738fbb0 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2093,9 +2093,7 @@ insert_clobber_before_stack_restore (tree saved_val, tree var, FOR_EACH_IMM_USE_STMT (stmt, iter, saved_val) if (gimple_call_builtin_p (stmt, BUILT_IN_STACK_RESTORE)) { - clobber = build_constructor (TREE_TYPE (var), - NULL); - TREE_THIS_VOLATILE (clobber) = 1; + clobber = build_clobber (TREE_TYPE (var)); clobber_stmt = gimple_build_assign (var, clobber); i = gsi_for_stmt (stmt); diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index b4b5c903e13..24dd8b32f7e 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -2016,9 +2016,7 @@ execute_update_addresses_taken (void) /* In ASAN_MARK (UNPOISON, &b, ...) the variable is uninitialized. Avoid dependencies on previous out of scope value. */ - tree clobber - = build_constructor (TREE_TYPE (var), NULL); - TREE_THIS_VOLATILE (clobber) = 1; + tree clobber = build_clobber (TREE_TYPE (var)); gimple *g = gimple_build_assign (var, clobber); gsi_replace (&gsi, g, GSI_SAME_STMT); } -- 2.30.2