tree.def (MISALIGNED_INDIRECT_REF): Remove.

2010-09-06  Richard Guenther  <rguenther@suse.de>

	* tree.def (MISALIGNED_INDIRECT_REF): Remove.
	* tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF.
	(build_aligned_type): Declare.
	* tree.c (check_qualified_type): Also compare TYPE_ALIGN.
	(check_aligned_type): New function.
	(build_aligned_type): Likewise.
	* expr.c (expand_assignment): Handle misaligned stores via
	TARGET_MEM_REF and MEM_REF using movmisalign_optab.
	(expand_expr_real_1): Likewise.
	(safe_from_p): Remove MISALIGNED_INDIRECT_REF handling.
	* tree-vect-stmts.c (vectorizable_store): Do not build
	MISALIGNED_INDIRECT_REF but initialize alignment information.
	(vectorizable_load): Likewise.
	* builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF
	handling.
	* cfgexpand.c (expand_debug_expr): Likewise.
	* dwarf2out.c (loc_list_from_tree): Likewise.
	* fold-const.c (maybe_lvalue_p): Likewise.
	(operand_equal_p): Likewise.
	(build_fold_addr_expr_with_type_loc): Likewise.
	* gimplify.c (gimplify_addr_expr): Likewise.
	(gimplify_expr): Likewise.
	* tree-cfg.c (verify_types_in_gimple_min_lval): Likewise.
	(verify_gimple_assign_single): Likewise.
	* tree-dump.c (dequeue_and_dump): Likewise.
	(tree_could_trap_p): Likewise.
	* tree-predcom.c (ref_at_iteration): Likewise.
	* tree-pretty-print.c (dump_generic_node): Likewise.
	(op_code_prio): Likewise.
	(op_symbol_code): Likewise.
	* tree-ssa-ccp.c (get_value_from_alignment): Likewise.
	* tree-ssa-loop-im.c (for_each_index): Likewise.
	(gen_lsm_tmp_name): Likewise.
	* tree-ssa-loop-ivopts.c (idx_find_step): Likewise.
	(find_interesting_uses_address): Likewise.
	* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
	* tree-ssa-operands.c (get_expr_operands): Likewise.
	* tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.
	* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
	(ao_ref_init_from_vn_reference): Likewise.
	* tree.c (staticp): Likewise.
	(build1_stat): Likewise.
	(reference_alias_ptr_type): Likewise.
	* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
	* config/rs6000/rs6000.c (rs6000_check_sdmode): Remove
	MISALIGNED_INDIRECT_REF handling.

From-SVN: r163915
This commit is contained in:
Richard Guenther 2010-09-06 13:26:13 +00:00 committed by Richard Biener
parent 863a75787c
commit be1ac4ecae
25 changed files with 258 additions and 232 deletions

View File

@ -1,3 +1,52 @@
2010-09-06 Richard Guenther <rguenther@suse.de>
* tree.def (MISALIGNED_INDIRECT_REF): Remove.
* tree.h (INDIRECT_REF_P): Only check for INDIRECT_REF.
(build_aligned_type): Declare.
* tree.c (check_qualified_type): Also compare TYPE_ALIGN.
(check_aligned_type): New function.
(build_aligned_type): Likewise.
* expr.c (expand_assignment): Handle misaligned stores via
TARGET_MEM_REF and MEM_REF using movmisalign_optab.
(expand_expr_real_1): Likewise.
(safe_from_p): Remove MISALIGNED_INDIRECT_REF handling.
* tree-vect-stmts.c (vectorizable_store): Do not build
MISALIGNED_INDIRECT_REF but initialize alignment information.
(vectorizable_load): Likewise.
* builtins.c (get_object_alignment): Remove MISALIGNED_INDIRECT_REF
handling.
* cfgexpand.c (expand_debug_expr): Likewise.
* dwarf2out.c (loc_list_from_tree): Likewise.
* fold-const.c (maybe_lvalue_p): Likewise.
(operand_equal_p): Likewise.
(build_fold_addr_expr_with_type_loc): Likewise.
* gimplify.c (gimplify_addr_expr): Likewise.
(gimplify_expr): Likewise.
* tree-cfg.c (verify_types_in_gimple_min_lval): Likewise.
(verify_gimple_assign_single): Likewise.
* tree-dump.c (dequeue_and_dump): Likewise.
(tree_could_trap_p): Likewise.
* tree-predcom.c (ref_at_iteration): Likewise.
* tree-pretty-print.c (dump_generic_node): Likewise.
(op_code_prio): Likewise.
(op_symbol_code): Likewise.
* tree-ssa-ccp.c (get_value_from_alignment): Likewise.
* tree-ssa-loop-im.c (for_each_index): Likewise.
(gen_lsm_tmp_name): Likewise.
* tree-ssa-loop-ivopts.c (idx_find_step): Likewise.
(find_interesting_uses_address): Likewise.
* tree-ssa-loop-prefetch.c (idx_analyze_ref): Likewise.
* tree-ssa-operands.c (get_expr_operands): Likewise.
* tree-ssa-pre.c (create_component_ref_by_pieces_1): Likewise.
* tree-ssa-sccvn.c (copy_reference_ops_from_ref): Likewise.
(ao_ref_init_from_vn_reference): Likewise.
* tree.c (staticp): Likewise.
(build1_stat): Likewise.
(reference_alias_ptr_type): Likewise.
* emit-rtl.c (set_mem_attributes_minus_bitpos): Likewise.
* config/rs6000/rs6000.c (rs6000_check_sdmode): Remove
MISALIGNED_INDIRECT_REF handling.
2010-09-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45534

View File

@ -301,11 +301,6 @@ get_object_alignment (tree exp, unsigned int max_align)
align = TYPE_ALIGN (TREE_TYPE (exp));
else if (TREE_CODE (exp) == INDIRECT_REF)
align = TYPE_ALIGN (TREE_TYPE (exp));
else if (TREE_CODE (exp) == MISALIGNED_INDIRECT_REF)
{
tree op1 = TREE_OPERAND (exp, 1);
align = integer_zerop (op1) ? BITS_PER_UNIT : TREE_INT_CST_LOW (op1);
}
else if (TREE_CODE (exp) == MEM_REF)
{
tree addr = TREE_OPERAND (exp, 0);

View File

@ -2450,7 +2450,6 @@ expand_debug_expr (tree exp)
return NULL;
/* Fallthru. */
case INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
op0 = expand_debug_expr (TREE_OPERAND (exp, 0));
if (!op0)
return NULL;

View File

@ -14138,7 +14138,6 @@ rs6000_check_sdmode (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
case SSA_NAME:
case REAL_CST:
case MEM_REF:
case MISALIGNED_INDIRECT_REF:
case VIEW_CONVERT_EXPR:
if (TYPE_MODE (TREE_TYPE (*tp)) == SDmode)
return *tp;

View File

@ -15230,7 +15230,6 @@ loc_list_from_tree (tree loc, int want_address)
return 0;
/* Fallthru. */
case INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
list_ret = loc_list_from_tree (TREE_OPERAND (loc, 0), 0);
have_address = 1;
break;

View File

@ -1620,15 +1620,6 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
type in all cases. */
align = MAX (align, TYPE_ALIGN (type));
else if (TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
{
if (integer_zerop (TREE_OPERAND (t, 1)))
/* We don't know anything about the alignment. */
align = BITS_PER_UNIT;
else
align = tree_low_cst (TREE_OPERAND (t, 1), 1);
}
/* If the size is known, we can set that. */
if (TYPE_SIZE_UNIT (type) && host_integerp (TYPE_SIZE_UNIT (type), 1))
size = GEN_INT (tree_low_cst (TYPE_SIZE_UNIT (type), 1));
@ -1782,8 +1773,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
}
/* If this is an indirect reference, record it. */
else if (TREE_CODE (t) == MEM_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
else if (TREE_CODE (t) == MEM_REF)
{
expr = t;
offset = const0_rtx;
@ -1793,8 +1783,7 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
/* If this is an indirect reference, record it. */
else if (TREE_CODE (t) == MEM_REF
|| TREE_CODE (t) == TARGET_MEM_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
|| TREE_CODE (t) == TARGET_MEM_REF)
{
expr = t;
offset = const0_rtx;

View File

@ -4151,6 +4151,8 @@ expand_assignment (tree to, tree from, bool nontemporal)
{
rtx to_rtx = 0;
rtx result;
enum machine_mode mode;
int align, icode;
/* Don't crash if the lhs of the assignment was erroneous. */
if (TREE_CODE (to) == ERROR_MARK)
@ -4163,6 +4165,68 @@ expand_assignment (tree to, tree from, bool nontemporal)
if (operand_equal_p (to, from, 0))
return;
mode = TYPE_MODE (TREE_TYPE (to));
if ((TREE_CODE (to) == MEM_REF
|| TREE_CODE (to) == TARGET_MEM_REF)
&& mode != BLKmode
&& ((align = MAX (TYPE_ALIGN (TREE_TYPE (to)),
get_object_alignment (to, BIGGEST_ALIGNMENT)))
< (signed) GET_MODE_ALIGNMENT (mode))
&& ((icode = optab_handler (movmisalign_optab, mode))
!= CODE_FOR_nothing))
{
enum machine_mode address_mode, op_mode1;
rtx insn, reg, op0, mem;
reg = expand_expr (from, NULL_RTX, VOIDmode, EXPAND_NORMAL);
reg = force_not_mem (reg);
if (TREE_CODE (to) == MEM_REF)
{
addr_space_t as
= TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 1))));
tree base = TREE_OPERAND (to, 0);
address_mode = targetm.addr_space.address_mode (as);
op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_NORMAL);
op0 = convert_memory_address_addr_space (address_mode, op0, as);
if (!integer_zerop (TREE_OPERAND (to, 1)))
{
rtx off
= immed_double_int_const (mem_ref_offset (to), address_mode);
op0 = simplify_gen_binary (PLUS, address_mode, op0, off);
}
op0 = memory_address_addr_space (mode, op0, as);
mem = gen_rtx_MEM (mode, op0);
set_mem_attributes (mem, to, 0);
set_mem_addr_space (mem, as);
}
else if (TREE_CODE (to) == TARGET_MEM_REF)
{
addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (to));
struct mem_address addr;
get_address_description (to, &addr);
op0 = addr_for_mem_ref (&addr, as, true);
op0 = memory_address_addr_space (mode, op0, as);
mem = gen_rtx_MEM (mode, op0);
set_mem_attributes (mem, to, 0);
set_mem_addr_space (mem, as);
}
else
gcc_unreachable ();
if (TREE_THIS_VOLATILE (to))
MEM_VOLATILE_P (mem) = 1;
op_mode1 = insn_data[icode].operand[1].mode;
if (! (*insn_data[icode].operand[1].predicate) (reg, op_mode1)
&& op_mode1 != VOIDmode)
reg = copy_to_mode_reg (op_mode1, reg);
insn = GEN_FCN (icode) (mem, reg);
emit_insn (insn);
return;
}
/* Assignment of a structure component needs special treatment
if the structure component's rtx is not simply a MEM.
Assignment of an array element at a constant index, and assignment of
@ -4297,41 +4361,6 @@ expand_assignment (tree to, tree from, bool nontemporal)
return;
}
else if (TREE_CODE (to) == MISALIGNED_INDIRECT_REF)
{
addr_space_t as = ADDR_SPACE_GENERIC;
enum machine_mode mode, op_mode1;
enum insn_code icode;
rtx reg, addr, mem, insn;
if (POINTER_TYPE_P (TREE_TYPE (TREE_OPERAND (to, 0))))
as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (TREE_OPERAND (to, 0))));
reg = expand_expr (from, NULL_RTX, VOIDmode, EXPAND_NORMAL);
reg = force_not_mem (reg);
mode = TYPE_MODE (TREE_TYPE (to));
addr = expand_expr (TREE_OPERAND (to, 0), NULL_RTX, VOIDmode,
EXPAND_SUM);
addr = memory_address_addr_space (mode, addr, as);
mem = gen_rtx_MEM (mode, addr);
set_mem_attributes (mem, to, 0);
set_mem_addr_space (mem, as);
icode = optab_handler (movmisalign_optab, mode);
gcc_assert (icode != CODE_FOR_nothing);
op_mode1 = insn_data[icode].operand[1].mode;
if (! (*insn_data[icode].operand[1].predicate) (reg, op_mode1)
&& op_mode1 != VOIDmode)
reg = copy_to_mode_reg (op_mode1, reg);
insn = GEN_FCN (icode) (mem, reg);
emit_insn (insn);
return;
}
/* If the rhs is a function call and its value is not an aggregate,
call the function before we start to compute the lhs.
This is needed for correct code for cases such as
@ -6659,8 +6688,7 @@ safe_from_p (const_rtx x, tree exp, int top_p)
}
break;
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
case MEM_REF:
if (MEM_P (x)
&& alias_sets_conflict_p (MEM_ALIAS_SET (x),
get_alias_set (exp)))
@ -8598,46 +8626,29 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return expand_constructor (exp, target, modifier, false);
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
case TARGET_MEM_REF:
{
tree exp1 = treeop0;
addr_space_t as = ADDR_SPACE_GENERIC;
addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
struct mem_address addr;
int icode, align;
if (modifier != EXPAND_WRITE)
{
tree t;
t = fold_read_from_constant_string (exp);
if (t)
return expand_expr (t, target, tmode, modifier);
}
if (POINTER_TYPE_P (TREE_TYPE (exp1)))
as = TYPE_ADDR_SPACE (TREE_TYPE (TREE_TYPE (exp1)));
op0 = expand_expr (exp1, NULL_RTX, VOIDmode, EXPAND_SUM);
get_address_description (exp, &addr);
op0 = addr_for_mem_ref (&addr, as, true);
op0 = memory_address_addr_space (mode, op0, as);
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, exp, 0);
set_mem_addr_space (temp, as);
/* Resolve the misalignment now, so that we don't have to remember
to resolve it later. Of course, this only works for reads. */
if (code == MISALIGNED_INDIRECT_REF)
align = MAX (TYPE_ALIGN (TREE_TYPE (exp)),
get_object_alignment (exp, BIGGEST_ALIGNMENT));
if (mode != BLKmode
&& (unsigned) align < GET_MODE_ALIGNMENT (mode)
/* If the target does not have special handling for unaligned
loads of mode then it can use regular moves for them. */
&& ((icode = optab_handler (movmisalign_optab, mode))
!= CODE_FOR_nothing))
{
int icode;
rtx reg, insn;
gcc_assert (modifier == EXPAND_NORMAL
|| modifier == EXPAND_STACK_PARM);
/* The vectorizer should have already checked the mode. */
icode = optab_handler (movmisalign_optab, mode);
gcc_assert (icode != CODE_FOR_nothing);
/* We've already validated the memory, and we're creating a
new pseudo destination. The predicates really can't fail. */
reg = gen_reg_rtx (mode);
@ -8648,24 +8659,9 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return reg;
}
return temp;
}
case TARGET_MEM_REF:
{
addr_space_t as = TYPE_ADDR_SPACE (TREE_TYPE (exp));
struct mem_address addr;
get_address_description (exp, &addr);
op0 = addr_for_mem_ref (&addr, as, true);
op0 = memory_address_addr_space (mode, op0, as);
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, exp, 0);
set_mem_addr_space (temp, as);
}
return temp;
case MEM_REF:
{
addr_space_t as
@ -8673,6 +8669,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
enum machine_mode address_mode;
tree base = TREE_OPERAND (exp, 0);
gimple def_stmt;
int icode, align;
/* Handle expansion of non-aliased memory with non-BLKmode. That
might end up in a register. */
if (TREE_CODE (base) == ADDR_EXPR)
@ -8717,9 +8714,14 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
address_mode = targetm.addr_space.address_mode (as);
base = TREE_OPERAND (exp, 0);
if ((def_stmt = get_def_for_expr (base, BIT_AND_EXPR)))
base = build2 (BIT_AND_EXPR, TREE_TYPE (base),
gimple_assign_rhs1 (def_stmt),
gimple_assign_rhs2 (def_stmt));
{
tree mask = gimple_assign_rhs2 (def_stmt);
base = build2 (BIT_AND_EXPR, TREE_TYPE (base),
gimple_assign_rhs1 (def_stmt), mask);
TREE_OPERAND (exp, 0) = base;
}
align = MAX (TYPE_ALIGN (TREE_TYPE (exp)),
get_object_alignment (exp, BIGGEST_ALIGNMENT));
op0 = expand_expr (base, NULL_RTX, VOIDmode, EXPAND_NORMAL);
op0 = convert_memory_address_addr_space (address_mode, op0, as);
if (!integer_zerop (TREE_OPERAND (exp, 1)))
@ -8734,6 +8736,25 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
set_mem_addr_space (temp, as);
if (TREE_THIS_VOLATILE (exp))
MEM_VOLATILE_P (temp) = 1;
if (mode != BLKmode
&& (unsigned) align < GET_MODE_ALIGNMENT (mode)
/* If the target does not have special handling for unaligned
loads of mode then it can use regular moves for them. */
&& ((icode = optab_handler (movmisalign_optab, mode))
!= CODE_FOR_nothing))
{
rtx reg, insn;
/* We've already validated the memory, and we're creating a
new pseudo destination. The predicates really can't fail. */
reg = gen_reg_rtx (mode);
/* Nor can the insn generator. */
insn = GEN_FCN (icode) (reg, temp);
emit_insn (insn);
return reg;
}
return temp;
}

View File

@ -2044,7 +2044,6 @@ maybe_lvalue_p (const_tree x)
case COMPONENT_REF:
case MEM_REF:
case INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case ARRAY_REF:
case ARRAY_RANGE_REF:
case BIT_FIELD_REF:
@ -2587,7 +2586,6 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
switch (TREE_CODE (arg0))
{
case INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case REALPART_EXPR:
case IMAGPART_EXPR:
return OP_SAME (0);
@ -7597,8 +7595,7 @@ build_fold_addr_expr_with_type_loc (location_t loc, tree t, tree ptrtype)
if (TREE_CODE (t) == WITH_SIZE_EXPR)
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == INDIRECT_REF
|| TREE_CODE (t) == MISALIGNED_INDIRECT_REF)
if (TREE_CODE (t) == INDIRECT_REF)
{
t = TREE_OPERAND (t, 0);

View File

@ -4791,7 +4791,6 @@ gimplify_addr_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p)
switch (TREE_CODE (op0))
{
case INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
do_indirect_ref:
/* Check if we are dealing with an expression of the form '&*ptr'.
While the front end folds away '&*ptr' into 'ptr', these
@ -6784,14 +6783,6 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
recalculate_side_effects (*expr_p);
break;
case MISALIGNED_INDIRECT_REF:
/* We can only reach this through re-gimplification from
tree optimizers. */
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_reg, fb_rvalue);
recalculate_side_effects (*expr_p);
break;
case INDIRECT_REF:
{
bool volatilep = TREE_THIS_VOLATILE (*expr_p);

View File

@ -2852,8 +2852,7 @@ verify_types_in_gimple_min_lval (tree expr)
if (is_gimple_id (expr))
return false;
if (TREE_CODE (expr) != MISALIGNED_INDIRECT_REF
&& TREE_CODE (expr) != TARGET_MEM_REF
if (TREE_CODE (expr) != TARGET_MEM_REF
&& TREE_CODE (expr) != MEM_REF)
{
error ("invalid expression for min lvalue");
@ -3723,7 +3722,6 @@ verify_gimple_assign_single (gimple stmt)
case COMPONENT_REF:
case BIT_FIELD_REF:
case MISALIGNED_INDIRECT_REF:
case ARRAY_REF:
case ARRAY_RANGE_REF:
case VIEW_CONVERT_EXPR:

View File

@ -572,7 +572,6 @@ dequeue_and_dump (dump_info_p di)
case TRUTH_NOT_EXPR:
case ADDR_EXPR:
case INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
case CLEANUP_POINT_EXPR:
case SAVE_EXPR:
case REALPART_EXPR:

View File

@ -2440,7 +2440,6 @@ tree_could_trap_p (tree expr)
return false;
/* Fallthru. */
case INDIRECT_REF:
case MISALIGNED_INDIRECT_REF:
return !TREE_THIS_NOTRAP (expr);
case ASM_EXPR:

View File

@ -1348,11 +1348,8 @@ ref_at_iteration (struct loop *loop, tree ref, int iter)
&& TREE_CODE (ref) != MEM_REF)
return unshare_expr (ref);
if (INDIRECT_REF_P (ref)
|| TREE_CODE (ref) == MEM_REF)
if (TREE_CODE (ref) == MEM_REF)
{
/* Take care for MEM_REF and MISALIGNED_INDIRECT_REF at
the same time. */
ret = unshare_expr (ref);
idx = TREE_OPERAND (ref, 0);
idx_p = &TREE_OPERAND (ret, 0);

View File

@ -1592,7 +1592,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
case ADDR_EXPR:
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
if (TREE_CODE (node) == ADDR_EXPR
&& (TREE_CODE (TREE_OPERAND (node, 0)) == STRING_CST
@ -1609,13 +1608,6 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
}
else
dump_generic_node (buffer, TREE_OPERAND (node, 0), spc, flags, false);
if (TREE_CODE (node) == MISALIGNED_INDIRECT_REF)
{
pp_string (buffer, "{misalignment: ");
dump_generic_node (buffer, TREE_OPERAND (node, 1), spc, flags, false);
pp_character (buffer, '}');
}
break;
case POSTDECREMENT_EXPR:
@ -2554,7 +2546,6 @@ op_code_prio (enum tree_code code)
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
case NEGATE_EXPR:
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
case ADDR_EXPR:
case FLOAT_EXPR:
@ -2724,9 +2715,6 @@ op_symbol_code (enum tree_code code)
case INDIRECT_REF:
return "*";
case MISALIGNED_INDIRECT_REF:
return "M*";
case TRUNC_DIV_EXPR:
case RDIV_EXPR:
return "/";

View File

@ -509,9 +509,7 @@ get_value_from_alignment (tree expr)
base = get_inner_reference (TREE_OPERAND (expr, 0),
&bitsize, &bitpos, &offset,
&mode, &align, &align, false);
if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
val = get_value_for_expr (TREE_OPERAND (base, 0), true);
else if (TREE_CODE (base) == MEM_REF)
if (TREE_CODE (base) == MEM_REF)
val = bit_value_binop (PLUS_EXPR, TREE_TYPE (expr),
TREE_OPERAND (base, 0), TREE_OPERAND (base, 1));
else if (base

View File

@ -272,7 +272,6 @@ for_each_index (tree *addr_p, bool (*cbck) (tree, tree *, void *), void *data)
case SSA_NAME:
return cbck (*addr_p, addr_p, data);
case MISALIGNED_INDIRECT_REF:
case MEM_REF:
nxt = &TREE_OPERAND (*addr_p, 0);
return cbck (*addr_p, nxt, data);
@ -1986,7 +1985,6 @@ gen_lsm_tmp_name (tree ref)
switch (TREE_CODE (ref))
{
case MISALIGNED_INDIRECT_REF:
case MEM_REF:
gen_lsm_tmp_name (TREE_OPERAND (ref, 0));
lsm_tmp_name_add ("_");

View File

@ -1443,9 +1443,6 @@ idx_find_step (tree base, tree *idx, void *data)
tree step, iv_base, iv_step, lbound, off;
struct loop *loop = dta->ivopts_data->current_loop;
if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
return false;
/* If base is a component ref, require that the offset of the reference
be invariant. */
if (TREE_CODE (base) == COMPONENT_REF)
@ -1765,8 +1762,6 @@ find_interesting_uses_address (struct ivopts_data *data, gimple stmt, tree *op_p
goto fail;
step = ifs_ivopts_data.step;
gcc_assert (TREE_CODE (base) != MISALIGNED_INDIRECT_REF);
/* Check that the base expression is addressable. This needs
to be done after substituting bases of IVs into it. */
if (may_be_nonaddressable_p (base))

View File

@ -423,9 +423,6 @@ idx_analyze_ref (tree base, tree *index, void *data)
HOST_WIDE_INT idelta = 0, imult = 1;
affine_iv iv;
if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
return false;
if (!simple_iv (ar_data->loop, loop_containing_stmt (ar_data->stmt),
*index, &iv, true))
return false;

View File

@ -711,8 +711,7 @@ mark_address_taken (tree ref)
}
/* A subroutine of get_expr_operands to handle MEM_REF,
MISALIGNED_INDIRECT_REF.
/* A subroutine of get_expr_operands to handle MEM_REF.
STMT is the statement being processed, EXPR is the MEM_REF
that got us here.
@ -908,10 +907,6 @@ get_expr_operands (gimple stmt, tree *expr_p, int flags)
gcc_assert (gimple_debug_bind_p (stmt));
return;
case MISALIGNED_INDIRECT_REF:
get_expr_operands (stmt, &TREE_OPERAND (expr, 1), flags);
/* fall through */
case MEM_REF:
get_indirect_ref_operands (stmt, expr, flags, true);
return;

View File

@ -2822,26 +2822,6 @@ create_component_ref_by_pieces_1 (basic_block block, vn_reference_t ref,
return folded;
}
break;
case MISALIGNED_INDIRECT_REF:
{
tree folded;
tree genop1 = create_component_ref_by_pieces_1 (block, ref,
operand,
stmts, domstmt);
if (!genop1)
return NULL_TREE;
genop1 = fold_convert (build_pointer_type (currop->type),
genop1);
if (currop->opcode == MISALIGNED_INDIRECT_REF)
folded = fold_build2 (currop->opcode, currop->type,
genop1, currop->op1);
else
folded = fold_build1 (currop->opcode, currop->type,
genop1);
return folded;
}
break;
case BIT_FIELD_REF:
{
tree folded;

View File

@ -616,9 +616,6 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
switch (temp.opcode)
{
case MISALIGNED_INDIRECT_REF:
temp.op0 = TREE_OPERAND (ref, 1);
break;
case MEM_REF:
/* The base address gets its own vn_reference_op_s structure. */
temp.op0 = TREE_OPERAND (ref, 1);
@ -801,12 +798,6 @@ ao_ref_init_from_vn_reference (ao_ref *ref,
return false;
/* Record the base objects. */
case MISALIGNED_INDIRECT_REF:
*op0_p = build2 (MISALIGNED_INDIRECT_REF, op->type,
NULL_TREE, op->op0);
op0_p = &TREE_OPERAND (*op0_p, 0);
break;
case MEM_REF:
base_alias_set = get_deref_alias_set (op->op0);
*op0_p = build2 (MEM_REF, op->type,

View File

@ -3347,6 +3347,8 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
next_stmt = first_stmt;
for (i = 0; i < vec_num; i++)
{
struct ptr_info_def *pi;
if (i > 0)
/* Bump the vector pointer. */
dataref_ptr = bump_vector_ptr (dataref_ptr, ptr_incr, gsi, stmt,
@ -3359,18 +3361,28 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
vect_permute_store_chain(). */
vec_oprnd = VEC_index (tree, result_chain, i);
data_ref = build2 (MEM_REF, TREE_TYPE (vec_oprnd), dataref_ptr,
build_int_cst (reference_alias_ptr_type
(DR_REF (first_dr)), 0));
pi = get_ptr_info (dataref_ptr);
pi->align = TYPE_ALIGN_UNIT (vectype);
if (aligned_access_p (first_dr))
data_ref
= build2 (MEM_REF, TREE_TYPE (vec_oprnd), dataref_ptr,
build_int_cst (reference_alias_ptr_type
(DR_REF (first_dr)), 0));
else
{
int mis = DR_MISALIGNMENT (first_dr);
tree tmis = (mis == -1 ? size_zero_node : size_int (mis));
tmis = size_binop (MULT_EXPR, tmis, size_int (BITS_PER_UNIT));
data_ref = build2 (MISALIGNED_INDIRECT_REF, vectype, dataref_ptr, tmis);
}
pi->misalign = 0;
else if (DR_MISALIGNMENT (first_dr) == -1)
{
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
TYPE_ALIGN (TREE_TYPE (vectype)));
pi->align = TYPE_ALIGN_UNIT (TREE_TYPE (vectype));
pi->misalign = 0;
}
else
{
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
TYPE_ALIGN (TREE_TYPE (vectype)));
pi->misalign = DR_MISALIGNMENT (first_dr);
}
/* Arguments are ready. Create the new vector stmt. */
new_stmt = gimple_build_assign (data_ref, vec_oprnd);
@ -3735,20 +3747,35 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
switch (alignment_support_scheme)
{
case dr_aligned:
gcc_assert (aligned_access_p (first_dr));
data_ref
= build2 (MEM_REF, vectype, dataref_ptr,
build_int_cst (reference_alias_ptr_type
(DR_REF (first_dr)), 0));
break;
case dr_unaligned_supported:
{
int mis = DR_MISALIGNMENT (first_dr);
tree tmis = (mis == -1 ? size_zero_node : size_int (mis));
tmis = size_binop (MULT_EXPR, tmis, size_int(BITS_PER_UNIT));
data_ref =
build2 (MISALIGNED_INDIRECT_REF, vectype, dataref_ptr, tmis);
struct ptr_info_def *pi;
data_ref
= build2 (MEM_REF, vectype, dataref_ptr,
build_int_cst (reference_alias_ptr_type
(DR_REF (first_dr)), 0));
pi = get_ptr_info (dataref_ptr);
pi->align = TYPE_ALIGN_UNIT (vectype);
if (alignment_support_scheme == dr_aligned)
{
gcc_assert (aligned_access_p (first_dr));
pi->misalign = 0;
}
else if (DR_MISALIGNMENT (first_dr) == -1)
{
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
TYPE_ALIGN (TREE_TYPE (vectype)));
pi->align = TYPE_ALIGN_UNIT (TREE_TYPE (vectype));
pi->misalign = 0;
}
else
{
TREE_TYPE (data_ref)
= build_aligned_type (TREE_TYPE (data_ref),
TYPE_ALIGN (TREE_TYPE (vectype)));
pi->misalign = DR_MISALIGNMENT (first_dr);
}
break;
}
case dr_explicit_realign:

View File

@ -2434,7 +2434,6 @@ staticp (tree arg)
case BIT_FIELD_REF:
return NULL;
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
return TREE_CONSTANT (TREE_OPERAND (arg, 0)) ? arg : NULL;
@ -3660,7 +3659,6 @@ build1_stat (enum tree_code code, tree type, tree node MEM_STAT_DECL)
TREE_READONLY (t) = 0;
break;
case MISALIGNED_INDIRECT_REF:
case INDIRECT_REF:
/* Whether a dereference is readonly has nothing to do with whether
its operand is readonly. */
@ -3929,8 +3927,6 @@ reference_alias_ptr_type (const_tree t)
return TREE_TYPE (TREE_OPERAND (base, 1));
else if (TREE_CODE (base) == TARGET_MEM_REF)
return TREE_TYPE (TMR_OFFSET (base));
else if (TREE_CODE (base) == MISALIGNED_INDIRECT_REF)
return NULL_TREE;
else
return build_pointer_type (TYPE_MAIN_VARIANT (TREE_TYPE (base)));
}
@ -5552,6 +5548,23 @@ check_qualified_type (const_tree cand, const_tree base, int type_quals)
&& TYPE_NAME (cand) == TYPE_NAME (base)
/* Apparently this is needed for Objective-C. */
&& TYPE_CONTEXT (cand) == TYPE_CONTEXT (base)
/* Check alignment. */
&& TYPE_ALIGN (cand) == TYPE_ALIGN (base)
&& attribute_list_equal (TYPE_ATTRIBUTES (cand),
TYPE_ATTRIBUTES (base)));
}
/* Returns true iff CAND is equivalent to BASE with ALIGN. */
static bool
check_aligned_type (const_tree cand, const_tree base, unsigned int align)
{
return (TYPE_QUALS (cand) == TYPE_QUALS (base)
&& TYPE_NAME (cand) == TYPE_NAME (base)
/* Apparently this is needed for Objective-C. */
&& TYPE_CONTEXT (cand) == TYPE_CONTEXT (base)
/* Check alignment. */
&& TYPE_ALIGN (cand) == align
&& attribute_list_equal (TYPE_ATTRIBUTES (cand),
TYPE_ATTRIBUTES (base)));
}
@ -5612,6 +5625,27 @@ build_qualified_type (tree type, int type_quals)
return t;
}
/* Create a variant of type T with alignment ALIGN. */
tree
build_aligned_type (tree type, unsigned int align)
{
tree t;
if (TYPE_PACKED (type)
|| TYPE_ALIGN (type) == align)
return type;
for (t = TYPE_MAIN_VARIANT (type); t; t = TYPE_NEXT_VARIANT (t))
if (check_aligned_type (t, type, align))
return t;
t = build_variant_type_copy (type);
TYPE_ALIGN (t) = align;
return t;
}
/* Create a new distinct copy of TYPE. The new type is made its own
MAIN_VARIANT. If TYPE requires structural equality checks, the
resulting type requires structural equality checks; otherwise, its

View File

@ -414,20 +414,9 @@ DEFTREECODE (ARRAY_REF, "array_ref", tcc_reference, 4)
of the range is taken from the type of the expression. */
DEFTREECODE (ARRAY_RANGE_REF, "array_range_ref", tcc_reference, 4)
/* The ordering of the following codes is optimized for the checking
macros in tree.h. Changing the order will degrade the speed of the
compiler. INDIRECT_REF, MISALIGNED_INDIRECT_REF. */
/* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */
DEFTREECODE (INDIRECT_REF, "indirect_ref", tcc_reference, 1)
/* Same as INDIRECT_REF, but also specifies the alignment of the referenced
address:
Operand 0 is the referenced address (a pointer);
Operand 1 is an INTEGER_CST which represents the alignment of the address,
or 0 if the alignment is unknown. */
DEFTREECODE (MISALIGNED_INDIRECT_REF, "misaligned_indirect_ref", tcc_reference, 2)
/* Used to represent lookup in a virtual method table which is dependent on
the runtime type of an object. Operands are:
OBJ_TYPE_REF_EXPR: An expression that evaluates the value to use.

View File

@ -117,8 +117,7 @@ extern const enum tree_code_class tree_code_type[];
ascending code order. */
#define INDIRECT_REF_P(CODE)\
(TREE_CODE (CODE) == INDIRECT_REF \
|| TREE_CODE (CODE) == MISALIGNED_INDIRECT_REF)
(TREE_CODE (CODE) == INDIRECT_REF)
/* Nonzero if CODE represents a reference. */
@ -602,7 +601,7 @@ struct GTY(()) tree_common {
all types
TREE_THIS_NOTRAP in
(ALIGN/MISALIGNED_)INDIRECT_REF, ARRAY_REF, ARRAY_RANGE_REF
INDIRECT_REF, ARRAY_REF, ARRAY_RANGE_REF
deprecated_flag:
@ -1250,8 +1249,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int,
/* Nonzero means this node will not trap. In an INDIRECT_REF, means
accessing the memory pointed to won't generate a trap. However,
this only applies to an object when used appropriately: it doesn't
mean that writing a READONLY mem won't trap. Similarly for
MISALIGNED_INDIRECT_REF.
mean that writing a READONLY mem won't trap.
In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index
(or slice of the array) always belongs to the range of the array.
@ -4306,6 +4304,10 @@ extern tree get_qualified_type (tree, int);
extern tree build_qualified_type (tree, int);
/* Create a variant of type T with alignment ALIGN. */
extern tree build_aligned_type (tree, unsigned int);
/* Like build_qualified_type, but only deals with the `const' and
`volatile' qualifiers. This interface is retained for backwards
compatibility with the various front-ends; new code should use