aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorBernd Edlinger <edlinger@gcc.gnu.org>2016-07-11 15:02:12 +0000
committerBernd Edlinger <edlinger@gcc.gnu.org>2016-07-11 15:02:12 +0000
commit25b75a48d2a2d0a4d65708da7402f238a10da115 (patch)
treea354fec980b4a777495acfd3885fe5e1fdd28ff4 /gcc/expr.c
parent9e34db2e031f28f7cc622b6955c241b47bbc081e (diff)
downloadgcc-25b75a48d2a2d0a4d65708da7402f238a10da115.zip
gcc-25b75a48d2a2d0a4d65708da7402f238a10da115.tar.gz
gcc-25b75a48d2a2d0a4d65708da7402f238a10da115.tar.bz2
Convert TYPE_ALIGN_OK to a TYPE_LANG_FLAG.
2016-07-11 Bernd Edlinger <bernd.edlinger@hotmail.de> Convert TYPE_ALIGN_OK to a TYPE_LANG_FLAG. * tree-core.h (tree_base::nothrow_flag): Adjust comment. (tree_type_common::lang_flag_7): New. (tree_type_common::spare): Reduce size. * tree.h (TYPE_ALIGN_OK): Remove. (TYPE_LANG_FLAG_7): New. (get_inner_reference): Adjust header. * print-tree.c (print_node): Adjust. * expr.c (get_inner_reference): Remove parameter keep_aligning. (get_bit_range, expand_assignment, expand_expr_addr_expr_1): Adjust calls to get_inner_reference. (expand_expr_real_1): Adjust call to get_inner_reference. Remove handling of TYPE_ALIGN_OK. * builtins.c (get_object_alignment_2): Adjust call to get_inner_reference. Remove handling of VIEW_CONVERT_EXPR. * emit-rtl.c (set_mem_attributes_minus_bitpos): Remove handling of TYPE_ALIGN_OK. * asan.c (instrument_derefs): Adjust calls to get_inner_reference. * cfgexpand.c (expand_debug_expr): Likewise. * dbxout.c (dbxout_expand_expr): Likewise. * dwarf2out.c (loc_list_for_address_of_addr_expr_of_indirect_ref, loc_list_from_tree, fortran_common): Likewise. * fold-const.c (optimize_bit_field_compare, decode_field_reference, fold_unary_loc, fold_comparison, split_address_to_core_and_offset): Likewise. * gimple-laddress.c (execute): Likewise. * gimple-ssa-strength-reduction.c (slsr_process_ref): Likewise. * gimplify.c (gimplify_scan_omp_clauses): Likewise. * hsa-gen.c (gen_hsa_addr): Likewise. * simplifx-rtx.c (delegitimize_mem_from_attrs): Likewise. * tsan.c (instrument_expr): Likewise. * ubsan.c (instrument_bool_enum_load, instrument_object_size): Likewise. * tree.c (verify_type_variant): Remove handling of TYPE_ALIGN_OK. * tree-affine.c (tree_to_aff_combination, get_inner_reference_aff): Adjust calls to get_inner_reference. * tree-data-ref.c (split_constant_offset_1, dr_analyze_innermost): Likewise. * tree-scalar-evolution.c (interpret_rhs_expr): Likewise. * tree-sra.c (ipa_sra_check_caller): Likewise. * tree-ssa-loop-ivopts.c (split_address_cost): Likewise. * tree-ssa-math-opts.c (find_bswap_or_nop_load, bswap_replace): Likewise. * tree-vect-data-refs.c (vect_check_gather, vect_analyze_data_refs): Likewise. * config/mips/mips.c (r10k_safe_mem_expr_p): Likewise. * config/pa/pa.c (pa_emit_move_sequence): Remove handling of TYPE_ALIGN_OK. ada: 2016-07-11 Bernd Edlinger <bernd.edlinger@hotmail.de> Convert TYPE_ALIGN_OK to a TYPE_LANG_FLAG. * gcc-interface/ada-tree.h (TYPE_ALIGN_OK): Define. * gcc-interface/trans.c (Attribute_to_gnu): Adjust call to get_inner_reference. * gcc-interface/utils2.c (build_unary_op): Likewise. From-SVN: r238210
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c55
1 files changed, 12 insertions, 43 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 6547be1..fbc91ad 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -4828,7 +4828,7 @@ get_bit_range (unsigned HOST_WIDE_INT *bitstart,
int unsignedp, reversep, volatilep = 0;
get_inner_reference (TREE_OPERAND (exp, 0), &rbitsize, &rbitpos,
&roffset, &rmode, &unsignedp, &reversep,
- &volatilep, false);
+ &volatilep);
if ((rbitpos % BITS_PER_UNIT) != 0)
{
*bitstart = *bitend = 0;
@@ -4984,7 +4984,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
push_temp_slots ();
tem = get_inner_reference (to, &bitsize, &bitpos, &offset, &mode1,
- &unsignedp, &reversep, &volatilep, true);
+ &unsignedp, &reversep, &volatilep);
/* Make sure bitpos is not negative, it can wreak havoc later. */
if (bitpos < 0)
@@ -6971,27 +6971,13 @@ store_field (rtx target, HOST_WIDE_INT bitsize, HOST_WIDE_INT bitpos,
If the field describes a variable-sized object, *PMODE is set to
BLKmode and *PBITSIZE is set to -1. An access cannot be made in
- this case, but the address of the object can be found.
-
- If KEEP_ALIGNING is true and the target is STRICT_ALIGNMENT, we don't
- look through nodes that serve as markers of a greater alignment than
- the one that can be deduced from the expression. These nodes make it
- possible for front-ends to prevent temporaries from being created by
- the middle-end on alignment considerations. For that purpose, the
- normal operating mode at high-level is to always pass FALSE so that
- the ultimate containing object is really returned; moreover, the
- associated predicate handled_component_p will always return TRUE
- on these nodes, thus indicating that they are essentially handled
- by get_inner_reference. TRUE should only be passed when the caller
- is scanning the expression in order to build another representation
- and specifically knows how to handle these nodes; as such, this is
- the normal operating mode in the RTL expanders. */
+ this case, but the address of the object can be found. */
tree
get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
HOST_WIDE_INT *pbitpos, tree *poffset,
machine_mode *pmode, int *punsignedp,
- int *preversep, int *pvolatilep, bool keep_aligning)
+ int *preversep, int *pvolatilep)
{
tree size_tree = 0;
machine_mode mode = VOIDmode;
@@ -7113,14 +7099,6 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
break;
case VIEW_CONVERT_EXPR:
- if (keep_aligning && STRICT_ALIGNMENT
- && (TYPE_ALIGN (TREE_TYPE (exp))
- > TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (exp, 0))))
- && (TYPE_ALIGN (TREE_TYPE (TREE_OPERAND (exp, 0)))
- < BIGGEST_ALIGNMENT)
- && (TYPE_ALIGN_OK (TREE_TYPE (exp))
- || TYPE_ALIGN_OK (TREE_TYPE (TREE_OPERAND (exp, 0)))))
- goto done;
break;
case MEM_REF:
@@ -7839,7 +7817,7 @@ expand_expr_addr_expr_1 (tree exp, rtx target, machine_mode tmode,
they won't change the final object whose address will be returned
(they actually exist only for that purpose). */
inner = get_inner_reference (exp, &bitsize, &bitpos, &offset, &mode1,
- &unsignedp, &reversep, &volatilep, false);
+ &unsignedp, &reversep, &volatilep);
break;
}
@@ -10369,7 +10347,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
int reversep, volatilep = 0, must_force_mem;
tree tem
= get_inner_reference (exp, &bitsize, &bitpos, &offset, &mode1,
- &unsignedp, &reversep, &volatilep, true);
+ &unsignedp, &reversep, &volatilep);
rtx orig_op0, memloc;
bool clear_mem_expr = false;
@@ -10767,7 +10745,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
int unsignedp, reversep, volatilep = 0;
tree tem
= get_inner_reference (treeop0, &bitsize, &bitpos, &offset, &mode1,
- &unsignedp, &reversep, &volatilep, true);
+ &unsignedp, &reversep, &volatilep);
rtx orig_op0;
/* ??? We should work harder and deal with non-zero offsets. */
@@ -10878,20 +10856,11 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
{
enum insn_code icode;
- if (TYPE_ALIGN_OK (type))
- {
- /* ??? Copying the MEM without substantially changing it might
- run afoul of the code handling volatile memory references in
- store_expr, which assumes that TARGET is returned unmodified
- if it has been used. */
- op0 = copy_rtx (op0);
- set_mem_align (op0, MAX (MEM_ALIGN (op0), TYPE_ALIGN (type)));
- }
- else if (modifier != EXPAND_WRITE
- && modifier != EXPAND_MEMORY
- && !inner_reference_p
- && mode != BLKmode
- && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode))
+ if (modifier != EXPAND_WRITE
+ && modifier != EXPAND_MEMORY
+ && !inner_reference_p
+ && mode != BLKmode
+ && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode))
{
/* If the target does have special handling for unaligned
loads of mode then use them. */