Add SET_DECL_MODE

This may no longer be necessary with the current version
of the SVE patches, but it does at least make things consistent
with the TYPE_MODE/SET_TYPE_MODE split.

gcc/ada/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* gcc-interface/utils.c (create_label_decl): Use SET_DECL_MODE.

gcc/c/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* c-decl.c (merge_decls): Use SET_DECL_MODE.
	(make_label, finish_struct): Likewise.

gcc/cp/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* class.c (finish_struct_bits): Use SET_DECL_MODE.
	(build_base_field_1, layout_class_type, finish_struct_1): Likewise.
	* decl.c (make_label_decl): Likewise.
	* pt.c (tsubst_decl): Likewise.

gcc/fortran/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* trans-common.c (build_common_decl): Use SET_DECL_MODE.
	* trans-decl.c (gfc_build_label_decl): Likewise.
	* trans-types.c (gfc_get_array_descr_info): Likewise.

gcc/lto/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* lto.c (offload_handle_link_vars): Use SET_DECL_MODE.

gcc/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* tree.h (SET_DECL_MODE): New macro.
	* cfgexpand.c (avoid_deep_ter_for_debug): Use SET_DECL_MODE.
	(expand_gimple_basic_block): Likewise.
	* function.c (split_complex_args): Likeise.
	* ipa-prop.c (ipa_modify_call_arguments): Likewise.
	* omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise.
	* stor-layout.c (layout_decl, relayout_decl): Likewise.
	(finish_bitfield_representative): Likewise.
	* tree.c (make_node_stat): Likewise.
	* tree-inline.c (remap_ssa_name): Likewise.
	(tree_function_versioning): Likewise.
	* tree-into-ssa.c (rewrite_debug_stmt_uses): Likewise.
	* tree-sra.c (sra_ipa_reset_debug_stmts): Likewise.
	* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise.
	* tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise.
	* tree-ssa.c (insert_debug_temp_for_var_def): Likewise.
	* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise.
	* varasm.c (make_debug_expr_from_rtl): Likewise.

libcc1/
2016-11-16  Richard Sandiford  <richard.sandiford@arm.com>
 	    Alan Hayward  <alan.hayward@arm.com>
 	    David Sherwood  <david.sherwood@arm.com>

	* plugin.cc (plugin_build_add_field): Use SET_DECL_MODE.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r242585
This commit is contained in:
Richard Sandiford 2016-11-18 10:03:12 +00:00 committed by Richard Sandiford
parent cd36a4518d
commit 899ca90e6d
32 changed files with 105 additions and 38 deletions

View File

@ -1,3 +1,26 @@
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* tree.h (SET_DECL_MODE): New macro.
* cfgexpand.c (avoid_deep_ter_for_debug): Use SET_DECL_MODE.
(expand_gimple_basic_block): Likewise.
* function.c (split_complex_args): Likeise.
* ipa-prop.c (ipa_modify_call_arguments): Likewise.
* omp-simd-clone.c (ipa_simd_modify_stmt_ops): Likewise.
* stor-layout.c (layout_decl, relayout_decl): Likewise.
(finish_bitfield_representative): Likewise.
* tree.c (make_node_stat): Likewise.
* tree-inline.c (remap_ssa_name): Likewise.
(tree_function_versioning): Likewise.
* tree-into-ssa.c (rewrite_debug_stmt_uses): Likewise.
* tree-sra.c (sra_ipa_reset_debug_stmts): Likewise.
* tree-ssa-ccp.c (optimize_atomic_bit_test_and): Likewise.
* tree-ssa-loop-ivopts.c (remove_unused_ivs): Likewise.
* tree-ssa.c (insert_debug_temp_for_var_def): Likewise.
* tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise.
* varasm.c (make_debug_expr_from_rtl): Likewise.
2016-11-18 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/71785

View File

@ -1,3 +1,9 @@
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* gcc-interface/utils.c (create_label_decl): Use SET_DECL_MODE.
2016-11-14 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/Makefile.in: Replace s-interr-hwint.adb with

View File

@ -3111,7 +3111,7 @@ create_label_decl (tree name, Node_Id gnat_node)
tree label_decl
= build_decl (input_location, LABEL_DECL, name, void_type_node);
DECL_MODE (label_decl) = VOIDmode;
SET_DECL_MODE (label_decl, VOIDmode);
/* Add this decl to the current binding level. */
gnat_pushdecl (label_decl, gnat_node);

View File

@ -1,3 +1,10 @@
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* c-decl.c (merge_decls): Use SET_DECL_MODE.
(make_label, finish_struct): Likewise.
2016-11-14 Prasad Ghangal <prasad.ghangal@gmail.com>
Richard Biener <rguenther@suse.de>

View File

@ -2373,7 +2373,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
/* Since the type is OLDDECL's, make OLDDECL's size go with. */
DECL_SIZE (newdecl) = DECL_SIZE (olddecl);
DECL_SIZE_UNIT (newdecl) = DECL_SIZE_UNIT (olddecl);
DECL_MODE (newdecl) = DECL_MODE (olddecl);
SET_DECL_MODE (newdecl, DECL_MODE (olddecl));
if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
{
SET_DECL_ALIGN (newdecl, DECL_ALIGN (olddecl));
@ -3521,7 +3521,7 @@ make_label (location_t location, tree name, bool defining,
{
tree label = build_decl (location, LABEL_DECL, name, void_type_node);
DECL_CONTEXT (label) = current_function_decl;
DECL_MODE (label) = VOIDmode;
SET_DECL_MODE (label, VOIDmode);
c_label_vars *label_vars = ggc_alloc<c_label_vars> ();
label_vars->shadowed = NULL;
@ -7995,7 +7995,7 @@ finish_struct (location_t loc, tree t, tree fieldlist, tree attributes,
{
TREE_TYPE (field)
= c_build_bitfield_integer_type (width, TYPE_UNSIGNED (type));
DECL_MODE (field) = TYPE_MODE (TREE_TYPE (field));
SET_DECL_MODE (field, TYPE_MODE (TREE_TYPE (field)));
}
DECL_INITIAL (field) = 0;
}

View File

@ -4053,7 +4053,7 @@ avoid_deep_ter_for_debug (gimple *stmt, int depth)
gimple *def_temp = gimple_build_debug_bind (vexpr, use, g);
DECL_ARTIFICIAL (vexpr) = 1;
TREE_TYPE (vexpr) = TREE_TYPE (use);
DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (use));
SET_DECL_MODE (vexpr, TYPE_MODE (TREE_TYPE (use)));
gimple_stmt_iterator gsi = gsi_for_stmt (g);
gsi_insert_after (&gsi, def_temp, GSI_NEW_STMT);
avoid_deep_ter_for_debug (def_temp, 0);
@ -5581,7 +5581,7 @@ expand_gimple_basic_block (basic_block bb, bool disable_tail_calls)
mode = DECL_MODE (value);
else
mode = TYPE_MODE (TREE_TYPE (value));
DECL_MODE (vexpr) = mode;
SET_DECL_MODE (vexpr, mode);
val = gen_rtx_VAR_LOCATION
(mode, vexpr, (rtx)value, VAR_INIT_STATUS_INITIALIZED);

View File

@ -1,3 +1,12 @@
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* class.c (finish_struct_bits): Use SET_DECL_MODE.
(build_base_field_1, layout_class_type, finish_struct_1): Likewise.
* decl.c (make_label_decl): Likewise.
* pt.c (tsubst_decl): Likewise.
2016-11-17 Jason Merrill <jason@redhat.com>
PR c++/78193 - inherited ctor regressions on sparc32.

View File

@ -2129,7 +2129,7 @@ finish_struct_bits (tree t)
|| TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t))
{
tree variants;
DECL_MODE (TYPE_MAIN_DECL (t)) = BLKmode;
SET_DECL_MODE (TYPE_MAIN_DECL (t), BLKmode);
for (variants = t; variants; variants = TYPE_NEXT_VARIANT (variants))
{
SET_TYPE_MODE (variants, BLKmode);
@ -4525,7 +4525,7 @@ build_base_field_1 (tree t, tree basetype, tree *&next_field)
DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype);
SET_DECL_ALIGN (decl, CLASSTYPE_ALIGN (basetype));
DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype);
DECL_MODE (decl) = TYPE_MODE (basetype);
SET_DECL_MODE (decl, TYPE_MODE (basetype));
DECL_FIELD_IS_BASE (decl) = 1;
/* Add the new FIELD_DECL to the list of fields for T. */
@ -6502,7 +6502,7 @@ layout_class_type (tree t, tree *virtuals_p)
field is effectively invisible. */
DECL_SIZE (field) = TYPE_SIZE (type);
/* We must also reset the DECL_MODE of the field. */
DECL_MODE (field) = TYPE_MODE (type);
SET_DECL_MODE (field, TYPE_MODE (type));
}
else
layout_nonempty_base_or_field (rli, field, NULL_TREE,
@ -7285,7 +7285,7 @@ finish_struct_1 (tree t)
if (VAR_P (x) && TREE_STATIC (x)
&& TREE_TYPE (x) != error_mark_node
&& same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (x)), t))
DECL_MODE (x) = TYPE_MODE (t);
SET_DECL_MODE (x, TYPE_MODE (t));
/* Done with FIELDS...now decide whether to sort these for
faster lookups later.

View File

@ -2967,7 +2967,7 @@ make_label_decl (tree id, int local_p)
decl = build_decl (input_location, LABEL_DECL, id, void_type_node);
DECL_CONTEXT (decl) = current_function_decl;
DECL_MODE (decl) = VOIDmode;
SET_DECL_MODE (decl, VOIDmode);
C_DECLARED_LABEL_FLAG (decl) = local_p;
/* Say where one reference is to the label, for the sake of the

View File

@ -12570,7 +12570,7 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
see [temp.inst]. */
DECL_INITIAL (r) = NULL_TREE;
if (VAR_P (r))
DECL_MODE (r) = VOIDmode;
SET_DECL_MODE (r, VOIDmode);
if (CODE_CONTAINS_STRUCT (TREE_CODE (t), TS_DECL_WRTL))
SET_DECL_RTL (r, NULL);
DECL_SIZE (r) = DECL_SIZE_UNIT (r) = 0;

View File

@ -1,3 +1,11 @@
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* trans-common.c (build_common_decl): Use SET_DECL_MODE.
* trans-decl.c (gfc_build_label_decl): Likewise.
* trans-types.c (gfc_get_array_descr_info): Likewise.
2016-11-17 Janus Weil <janus@gcc.gnu.org>
PR fortran/66227

View File

@ -408,7 +408,7 @@ build_common_decl (gfc_common_head *com, tree union_type, bool is_init)
{
DECL_SIZE (decl) = TYPE_SIZE (union_type);
DECL_SIZE_UNIT (decl) = size;
DECL_MODE (decl) = TYPE_MODE (union_type);
SET_DECL_MODE (decl, TYPE_MODE (union_type));
TREE_TYPE (decl) = union_type;
layout_decl (decl, 0);
}

View File

@ -274,7 +274,7 @@ gfc_build_label_decl (tree label_id)
label_decl = build_decl (input_location,
LABEL_DECL, label_id, void_type_node);
DECL_CONTEXT (label_decl) = current_function_decl;
DECL_MODE (label_decl) = VOIDmode;
SET_DECL_MODE (label_decl, VOIDmode);
/* We always define the label as used, even if the original source
file never references the label. We don't want all kinds of

View File

@ -3188,7 +3188,7 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info)
base_decl = make_node (DEBUG_EXPR_DECL);
DECL_ARTIFICIAL (base_decl) = 1;
TREE_TYPE (base_decl) = indirect ? build_pointer_type (ptype) : ptype;
DECL_MODE (base_decl) = TYPE_MODE (TREE_TYPE (base_decl));
SET_DECL_MODE (base_decl, TYPE_MODE (TREE_TYPE (base_decl)));
GFC_TYPE_ARRAY_BASE_DECL (type, indirect) = base_decl;
}
info->base_decl = base_decl;

View File

@ -2322,7 +2322,7 @@ split_complex_args (vec<tree> *args)
p = copy_node (p);
TREE_TYPE (p) = subtype;
DECL_ARG_TYPE (p) = TREE_TYPE (DECL_ARG_TYPE (p));
DECL_MODE (p) = VOIDmode;
SET_DECL_MODE (p, VOIDmode);
DECL_SIZE (p) = NULL;
DECL_SIZE_UNIT (p) = NULL;
/* If this arg must go in memory, put it in a pseudo here.

View File

@ -4344,7 +4344,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gcall *stmt,
ddecl = make_node (DEBUG_EXPR_DECL);
DECL_ARTIFICIAL (ddecl) = 1;
TREE_TYPE (ddecl) = TREE_TYPE (origin);
DECL_MODE (ddecl) = DECL_MODE (origin);
SET_DECL_MODE (ddecl, DECL_MODE (origin));
vec_safe_push (*debug_args, origin);
vec_safe_push (*debug_args, ddecl);

View File

@ -1,3 +1,9 @@
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* lto.c (offload_handle_link_vars): Use SET_DECL_MODE.
2016-10-31 Richard Biener <rguenther@suse.de>
PR lto/78129

View File

@ -3242,7 +3242,7 @@ offload_handle_link_vars (void)
TREE_TYPE (link_ptr_var) = type;
TREE_USED (link_ptr_var) = 1;
TREE_STATIC (link_ptr_var) = 1;
DECL_MODE (link_ptr_var) = TYPE_MODE (type);
SET_DECL_MODE (link_ptr_var, TYPE_MODE (type));
DECL_SIZE (link_ptr_var) = TYPE_SIZE (type);
DECL_SIZE_UNIT (link_ptr_var) = TYPE_SIZE_UNIT (type);
DECL_ARTIFICIAL (link_ptr_var) = 1;

View File

@ -868,7 +868,7 @@ ipa_simd_modify_stmt_ops (tree *tp, int *walk_subtrees, void *data)
stmt = gimple_build_debug_source_bind (vexpr, repl, NULL);
DECL_ARTIFICIAL (vexpr) = 1;
TREE_TYPE (vexpr) = TREE_TYPE (repl);
DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (repl));
SET_DECL_MODE (vexpr, TYPE_MODE (TREE_TYPE (repl)));
repl = vexpr;
}
else

View File

@ -616,7 +616,7 @@ layout_decl (tree decl, unsigned int known_align)
DECL_UNSIGNED (decl) = TYPE_UNSIGNED (type);
if (DECL_MODE (decl) == VOIDmode)
DECL_MODE (decl) = TYPE_MODE (type);
SET_DECL_MODE (decl, TYPE_MODE (type));
if (DECL_SIZE (decl) == 0)
{
@ -682,7 +682,7 @@ layout_decl (tree decl, unsigned int known_align)
&& (known_align == 0 || known_align >= xalign))
{
SET_DECL_ALIGN (decl, MAX (xalign, DECL_ALIGN (decl)));
DECL_MODE (decl) = xmode;
SET_DECL_MODE (decl, xmode);
DECL_BIT_FIELD (decl) = 0;
}
}
@ -776,7 +776,7 @@ void
relayout_decl (tree decl)
{
DECL_SIZE (decl) = DECL_SIZE_UNIT (decl) = 0;
DECL_MODE (decl) = VOIDmode;
SET_DECL_MODE (decl, VOIDmode);
if (!DECL_USER_ALIGN (decl))
SET_DECL_ALIGN (decl, 0);
if (DECL_RTL_SET_P (decl))
@ -1906,7 +1906,7 @@ finish_bitfield_representative (tree repr, tree field)
[0, 15] HImode for a and b, [8, 23] HImode for c. */
DECL_SIZE (repr) = bitsize_int (bitsize);
DECL_SIZE_UNIT (repr) = size_int (bitsize / BITS_PER_UNIT);
DECL_MODE (repr) = BLKmode;
SET_DECL_MODE (repr, BLKmode);
TREE_TYPE (repr) = build_array_type_nelts (unsigned_char_type_node,
bitsize / BITS_PER_UNIT);
}
@ -1915,7 +1915,7 @@ finish_bitfield_representative (tree repr, tree field)
unsigned HOST_WIDE_INT modesize = GET_MODE_BITSIZE (mode);
DECL_SIZE (repr) = bitsize_int (modesize);
DECL_SIZE_UNIT (repr) = size_int (modesize / BITS_PER_UNIT);
DECL_MODE (repr) = mode;
SET_DECL_MODE (repr, mode);
TREE_TYPE (repr) = lang_hooks.types.type_for_mode (mode, 1);
}

View File

@ -214,7 +214,7 @@ remap_ssa_name (tree name, copy_body_data *id)
def_temp = gimple_build_debug_source_bind (vexpr, val, NULL);
DECL_ARTIFICIAL (vexpr) = 1;
TREE_TYPE (vexpr) = TREE_TYPE (name);
DECL_MODE (vexpr) = DECL_MODE (SSA_NAME_VAR (name));
SET_DECL_MODE (vexpr, DECL_MODE (SSA_NAME_VAR (name)));
gsi = gsi_after_labels (single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)));
gsi_insert_before (&gsi, def_temp, GSI_SAME_STMT);
return vexpr;
@ -6070,7 +6070,7 @@ tree_function_versioning (tree old_decl, tree new_decl,
ddecl = make_node (DEBUG_EXPR_DECL);
DECL_ARTIFICIAL (ddecl) = 1;
TREE_TYPE (ddecl) = TREE_TYPE (parm);
DECL_MODE (ddecl) = DECL_MODE (parm);
SET_DECL_MODE (ddecl, DECL_MODE (parm));
vec_safe_push (*debug_args, DECL_ORIGIN (parm));
vec_safe_push (*debug_args, ddecl);
}
@ -6102,7 +6102,7 @@ tree_function_versioning (tree old_decl, tree new_decl,
parm = (**debug_args)[i];
DECL_ARTIFICIAL (vexpr) = 1;
TREE_TYPE (vexpr) = TREE_TYPE (parm);
DECL_MODE (vexpr) = DECL_MODE (parm);
SET_DECL_MODE (vexpr, DECL_MODE (parm));
def_temp = gimple_build_debug_bind (var, vexpr, NULL);
gsi_insert_before (&cgsi, def_temp, GSI_NEW_STMT);
def_temp = gimple_build_debug_source_bind (vexpr, parm, NULL);

View File

@ -1229,7 +1229,7 @@ rewrite_debug_stmt_uses (gimple *stmt)
def_temp = gimple_build_debug_source_bind (def, var, NULL);
DECL_ARTIFICIAL (def) = 1;
TREE_TYPE (def) = TREE_TYPE (var);
DECL_MODE (def) = DECL_MODE (var);
SET_DECL_MODE (def, DECL_MODE (var));
gsi =
gsi_after_labels (single_succ (ENTRY_BLOCK_PTR_FOR_FN (cfun)));
gsi_insert_before (&gsi, def_temp, GSI_SAME_STMT);

View File

@ -5000,7 +5000,7 @@ sra_ipa_reset_debug_stmts (ipa_parm_adjustment_vec adjustments)
NULL);
DECL_ARTIFICIAL (vexpr) = 1;
TREE_TYPE (vexpr) = TREE_TYPE (name);
DECL_MODE (vexpr) = DECL_MODE (adj->base);
SET_DECL_MODE (vexpr, DECL_MODE (adj->base));
gsi_insert_before (gsip, def_temp, GSI_SAME_STMT);
}
if (vexpr)

View File

@ -2905,7 +2905,7 @@ optimize_atomic_bit_test_and (gimple_stmt_iterator *gsip,
tree temp = make_node (DEBUG_EXPR_DECL);
DECL_ARTIFICIAL (temp) = 1;
TREE_TYPE (temp) = TREE_TYPE (lhs);
DECL_MODE (temp) = TYPE_MODE (TREE_TYPE (lhs));
SET_DECL_MODE (temp, TYPE_MODE (TREE_TYPE (lhs)));
tree t = build2 (LSHIFT_EXPR, TREE_TYPE (lhs), new_lhs, bit);
g = gimple_build_debug_bind (temp, t, g);
gsi_insert_after (&gsi, g, GSI_NEW_STMT);

View File

@ -7589,9 +7589,9 @@ remove_unused_ivs (struct ivopts_data *data)
DECL_ARTIFICIAL (vexpr) = 1;
TREE_TYPE (vexpr) = TREE_TYPE (comp);
if (SSA_NAME_VAR (def))
DECL_MODE (vexpr) = DECL_MODE (SSA_NAME_VAR (def));
SET_DECL_MODE (vexpr, DECL_MODE (SSA_NAME_VAR (def)));
else
DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (vexpr));
SET_DECL_MODE (vexpr, TYPE_MODE (TREE_TYPE (vexpr)));
gdebug *def_temp
= gimple_build_debug_bind (vexpr, comp, NULL);
gimple_stmt_iterator gsi;

View File

@ -432,9 +432,9 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var)
DECL_ARTIFICIAL (vexpr) = 1;
TREE_TYPE (vexpr) = TREE_TYPE (value);
if (DECL_P (value))
DECL_MODE (vexpr) = DECL_MODE (value);
SET_DECL_MODE (vexpr, DECL_MODE (value));
else
DECL_MODE (vexpr) = TYPE_MODE (TREE_TYPE (value));
SET_DECL_MODE (vexpr, TYPE_MODE (TREE_TYPE (value)));
if (gsi)
gsi_insert_before (gsi, def_temp, GSI_SAME_STMT);

View File

@ -220,7 +220,7 @@ unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr)
static void
unpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_MODE (expr) = bp_unpack_machine_mode (bp);
SET_DECL_MODE (expr, bp_unpack_machine_mode (bp));
DECL_NONLOCAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_VIRTUAL_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IGNORED_P (expr) = (unsigned) bp_unpack_value (bp, 1);

View File

@ -1020,7 +1020,7 @@ make_node_stat (enum tree_code code MEM_STAT_DECL)
if (code == FUNCTION_DECL)
{
SET_DECL_ALIGN (t, FUNCTION_ALIGNMENT (FUNCTION_BOUNDARY));
DECL_MODE (t) = FUNCTION_MODE;
SET_DECL_MODE (t, FUNCTION_MODE);
}
else
SET_DECL_ALIGN (t, 1);

View File

@ -2350,6 +2350,8 @@ extern machine_mode element_mode (const_tree t);
field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
FIELD_DECL. */
#define DECL_MODE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.mode)
#define SET_DECL_MODE(NODE, MODE) \
(DECL_COMMON_CHECK (NODE)->decl_common.mode = (MODE))
/* For FUNCTION_DECL, if it is built-in, this identifies which built-in
operation it is. Note, however, that this field is overloaded, with

View File

@ -7628,7 +7628,7 @@ make_debug_expr_from_rtl (const_rtx exp)
TREE_TYPE (ddecl) = type;
else
TREE_TYPE (ddecl) = lang_hooks.types.type_for_mode (mode, 1);
DECL_MODE (ddecl) = mode;
SET_DECL_MODE (ddecl, mode);
dval = gen_rtx_DEBUG_EXPR (mode);
DEBUG_EXPR_TREE_DECL (dval) = ddecl;
SET_DECL_RTL (ddecl, dval);

View File

@ -1,3 +1,9 @@
2016-11-18 Richard Sandiford <richard.sandiford@arm.com>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* plugin.cc (plugin_build_add_field): Use SET_DECL_MODE.
2016-06-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Update copyrights.

View File

@ -511,7 +511,7 @@ plugin_build_add_field (cc1_plugin::connection *,
= c_build_bitfield_integer_type (bitsize, TYPE_UNSIGNED (field_type));
}
DECL_MODE (decl) = TYPE_MODE (TREE_TYPE (decl));
SET_DECL_MODE (decl, TYPE_MODE (TREE_TYPE (decl)));
// There's no way to recover this from DWARF.
SET_DECL_OFFSET_ALIGN (decl, TYPE_PRECISION (pointer_sized_int_node));