diff options
author | Martin Jambor <mjambor@suse.cz> | 2021-11-09 17:54:23 +0100 |
---|---|---|
committer | Martin Jambor <mjambor@suse.cz> | 2021-11-09 17:54:28 +0100 |
commit | 2d60c0a3eedea4d0f1d40806a5f95540a1a4219e (patch) | |
tree | 220f83c75f7eb1fac9861df32ddbad7bad79621c /gcc/tree-ssa-reassoc.c | |
parent | 3bc3f6cefc2b92d368affacb74928948388c4786 (diff) | |
download | gcc-2d60c0a3eedea4d0f1d40806a5f95540a1a4219e.zip gcc-2d60c0a3eedea4d0f1d40806a5f95540a1a4219e.tar.gz gcc-2d60c0a3eedea4d0f1d40806a5f95540a1a4219e.tar.bz2 |
Introduce build_debug_expr_decl
This patch introduces a helper function build_debug_expr_decl to build
DEBUG_EXPR_DECL tree nodes in the most common way and replaces with a
call of this function all code pieces which build such a DECL itself
and sets its mode to the TYPE_MODE of its type.
There still remain 11 instances of open-coded creation of a
DEBUG_EXPR_DECL which set the mode of the DECL to something else. It
would probably be a good idea to figure out that has any effect and if
not, convert them to calls of build_debug_expr_decl too. But this
patch deliberately does not introduce any functional changes.
gcc/ChangeLog:
2021-11-08 Martin Jambor <mjambor@suse.cz>
* tree.h (build_debug_expr_decl): Declare.
* tree.c (build_debug_expr_decl): New function.
* cfgexpand.c (avoid_deep_ter_for_debug): Use build_debug_expr_decl
instead of building a DEBUG_EXPR_DECL.
* ipa-param-manipulation.c
(ipa_param_body_adjustments::prepare_debug_expressions): Likewise.
* omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise.
* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise.
* tree-ssa-phiopt.c (spaceship_replacement): Likewise.
* tree-ssa-reassoc.c (make_new_ssa_for_def): Likewise.
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r-- | gcc/tree-ssa-reassoc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index db9fb4e..6a555e7 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -1259,15 +1259,12 @@ make_new_ssa_for_def (gimple *stmt, enum tree_code opcode, tree op) { if (new_debug_lhs == NULL_TREE) { - new_debug_lhs = make_node (DEBUG_EXPR_DECL); + new_debug_lhs = build_debug_expr_decl (TREE_TYPE (lhs)); gdebug *def_temp = gimple_build_debug_bind (new_debug_lhs, build2 (opcode, TREE_TYPE (lhs), new_lhs, op), stmt); - DECL_ARTIFICIAL (new_debug_lhs) = 1; - TREE_TYPE (new_debug_lhs) = TREE_TYPE (lhs); - SET_DECL_MODE (new_debug_lhs, TYPE_MODE (TREE_TYPE (lhs))); gimple_set_uid (def_temp, gimple_uid (stmt)); gimple_stmt_iterator gsi = gsi_for_stmt (stmt); gsi_insert_after (&gsi, def_temp, GSI_SAME_STMT); |