* alias.c (ao_ref_from_mem): Adjust.
* builtins.c (get_object_alignment): Likewise.
* cfgexpand.c (expand_debug_expr): Likewise.
* gimple.c (get_base_address): Likewise.
* tree-dfa.c (get_ref_base_and_extent): Likewise.
(get_addr_base_and_unit_offset): Likewise. Fix for
both TMR_SYMBOL and TMR_BASE being set.
* tree-eh.c (tree_could_trap_p): Likewise.
* gimplify.c (gimplify_expr): Do not attempt to gimplify
TMR_SYMBOL. Always gimplify TMR_BASE.
* tree-cfg.c (verify_types_in_gimple_reference): Verify
TMR_BASE if there is a TMR_SYMBOL.
* tree-pretty-print.c (dump_generic_node): Adjust.
* tree-ssa-address.c (addr_for_mem_ref): Likewise.
(tree_mem_ref_addr): Likewise.
(create_mem_ref_raw): Likewise.
(move_fixed_address_to_symbol): Likewise.
(create_mem_ref): Likewise.
(dump_mem_address): Likewise.
* tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Adjust.
Fix for both TMR_SYMBOL and TMR_BASE being set.
(indirect_refs_may_alias_p): Likewise.
* tree-ssa-operands.c (get_tmr_operands): Adjust.
* tree.def (TARGET_MEM_REF): Adjust documentation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163733
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-09-01 Richard Guenther <rguenther@suse.de>
+
+ * alias.c (ao_ref_from_mem): Adjust.
+ * builtins.c (get_object_alignment): Likewise.
+ * cfgexpand.c (expand_debug_expr): Likewise.
+ * gimple.c (get_base_address): Likewise.
+ * tree-dfa.c (get_ref_base_and_extent): Likewise.
+ (get_addr_base_and_unit_offset): Likewise. Fix for
+ both TMR_SYMBOL and TMR_BASE being set.
+ * tree-eh.c (tree_could_trap_p): Likewise.
+ * gimplify.c (gimplify_expr): Do not attempt to gimplify
+ TMR_SYMBOL. Always gimplify TMR_BASE.
+ * tree-cfg.c (verify_types_in_gimple_reference): Verify
+ TMR_BASE if there is a TMR_SYMBOL.
+ * tree-pretty-print.c (dump_generic_node): Adjust.
+ * tree-ssa-address.c (addr_for_mem_ref): Likewise.
+ (tree_mem_ref_addr): Likewise.
+ (create_mem_ref_raw): Likewise.
+ (move_fixed_address_to_symbol): Likewise.
+ (create_mem_ref): Likewise.
+ (dump_mem_address): Likewise.
+ * tree-ssa-alias.c (indirect_ref_may_alias_decl_p): Adjust.
+ Fix for both TMR_SYMBOL and TMR_BASE being set.
+ (indirect_refs_may_alias_p): Likewise.
+ * tree-ssa-operands.c (get_tmr_operands): Adjust.
+ * tree.def (TARGET_MEM_REF): Adjust documentation.
+
2010-09-01 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.h (enum ix86_tune_indices) <X86_TUNE_SINGLE_POP>:
}
else if (TREE_CODE (base) == TARGET_MEM_REF
&& TMR_SYMBOL (base)
- && TREE_CODE (TMR_SYMBOL (base)) == VAR_DECL
- && ! TREE_STATIC (TMR_SYMBOL (base))
+ && TREE_CODE (TREE_OPERAND (TMR_SYMBOL (base), 0)) == VAR_DECL
+ && ! TREE_STATIC (TREE_OPERAND (TMR_SYMBOL (base), 0))
&& cfun->gimple_df->decls_to_pointers != NULL)
{
void *namep;
namep = pointer_map_contains (cfun->gimple_df->decls_to_pointers,
- TMR_SYMBOL (base));
+ TREE_OPERAND (TMR_SYMBOL (base), 0));
if (namep)
ref->base = build_simple_mem_ref (*(tree *)namep);
}
else if (TREE_CODE (exp) == TARGET_MEM_REF
&& TMR_SYMBOL (exp))
{
- align = get_object_alignment (TMR_SYMBOL (exp), max_align);
+ align = get_object_alignment (TREE_OPERAND (TMR_SYMBOL (exp), 0),
+ max_align);
if (TMR_OFFSET (exp))
bitpos += TREE_INT_CST_LOW (TMR_OFFSET (exp)) * BITS_PER_UNIT;
if (TMR_INDEX (exp) && TMR_STEP (exp))
}
else if (TMR_INDEX (exp))
align = BITS_PER_UNIT;
+ if (TMR_BASE (exp))
+ align = BITS_PER_UNIT;
}
else
align = BITS_PER_UNIT;
return op0;
case TARGET_MEM_REF:
- if (TMR_SYMBOL (exp) && !DECL_RTL_SET_P (TMR_SYMBOL (exp)))
+ if (TMR_SYMBOL (exp)
+ && !DECL_RTL_SET_P (TREE_OPERAND (TMR_SYMBOL (exp), 0)))
return NULL;
op0 = expand_debug_expr
t = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
else if (TREE_CODE (t) == TARGET_MEM_REF
&& TMR_SYMBOL (t))
- t = TMR_SYMBOL (t);
+ t = TREE_OPERAND (TMR_SYMBOL (t), 0);
if (SSA_VAR_P (t)
|| TREE_CODE (t) == STRING_CST
enum gimplify_status r0 = GS_ALL_DONE, r1 = GS_ALL_DONE;
if (TMR_SYMBOL (*expr_p))
- r0 = gimplify_expr (&TMR_SYMBOL (*expr_p), pre_p,
- post_p, is_gimple_lvalue, fb_either);
- else if (TMR_BASE (*expr_p))
+ /* We can't gimplify the symbol part. Assert it is
+ already gimple instead.
+ ??? This isn't exactly the same as ADDR_EXPR
+ plus is_gimple_mem_ref_addr (), see fixed_address_object_p. */
+ gcc_assert (TREE_CODE (TMR_SYMBOL (*expr_p)) == ADDR_EXPR
+ && (TREE_CODE (TREE_OPERAND (TMR_SYMBOL (*expr_p), 0))
+ == VAR_DECL));
+ if (TMR_BASE (*expr_p))
r0 = gimplify_expr (&TMR_BASE (*expr_p), pre_p,
post_p, is_gimple_val, fb_either);
if (TMR_INDEX (*expr_p))
}
else if (TREE_CODE (expr) == TARGET_MEM_REF)
{
+ if (TMR_SYMBOL (expr)
+ && TMR_BASE (expr)
+ && !useless_type_conversion_p (sizetype, TREE_TYPE (TMR_BASE (expr))))
+ {
+ error ("Non-sizetype base in TARGET_MEM_REF with symbol");
+ return true;
+ }
if (!TMR_OFFSET (expr)
|| TREE_CODE (TMR_OFFSET (expr)) != INTEGER_CST
|| !POINTER_TYPE_P (TREE_TYPE (TMR_OFFSET (expr))))
/* Hand back the decl for MEM[&decl, off]. */
if (TMR_SYMBOL (exp))
{
- /* Via the variable index we can reach the whole object. */
- if (TMR_INDEX (exp))
+ /* Via the variable index or base we can reach the
+ whole object. */
+ if (TMR_INDEX (exp) || TMR_BASE (exp))
{
- exp = TMR_SYMBOL (exp);
+ exp = TREE_OPERAND (TMR_SYMBOL (exp), 0);
bit_offset = 0;
maxsize = -1;
goto done;
}
if (integer_zerop (TMR_OFFSET (exp)))
- exp = TMR_SYMBOL (exp);
+ exp = TREE_OPERAND (TMR_SYMBOL (exp), 0);
else
{
double_int off = mem_ref_offset (exp);
if (double_int_fits_in_shwi_p (off))
{
bit_offset = double_int_to_shwi (off);
- exp = TMR_SYMBOL (exp);
+ exp = TREE_OPERAND (TMR_SYMBOL (exp), 0);
}
}
}
/* Hand back the decl for MEM[&decl, off]. */
if (TMR_SYMBOL (exp))
{
- if (TMR_SYMBOL (exp))
+ if (TMR_INDEX (exp) || TMR_BASE (exp))
return NULL_TREE;
if (!integer_zerop (TMR_OFFSET (exp)))
{
gcc_assert (off.high == -1 || off.high == 0);
byte_offset += double_int_to_shwi (off);
}
- exp = TMR_SYMBOL (exp);
+ exp = TREE_OPERAND (TMR_SYMBOL (exp), 0);
}
goto done;
{
case TARGET_MEM_REF:
if (TMR_SYMBOL (expr)
- && !TMR_INDEX (expr))
+ && !TMR_INDEX (expr) && !TMR_BASE (expr))
return false;
return !TREE_THIS_NOTRAP (expr);
pp_string (buffer, sep);
sep = ", ";
pp_string (buffer, "symbol: ");
- dump_generic_node (buffer, tmp, spc, flags, false);
+ dump_generic_node (buffer, TREE_OPERAND (tmp, 0),
+ spc, flags, false);
}
tmp = TMR_BASE (node);
if (tmp)
/* Otherwise really expand the expressions. */
sym = (addr->symbol
- ? expand_expr (build_addr (addr->symbol, current_function_decl),
- NULL_RTX, address_mode, EXPAND_NORMAL)
+ ? expand_expr (addr->symbol, NULL_RTX, address_mode, EXPAND_NORMAL)
: NULL_RTX);
bse = (addr->base
? expand_expr (addr->base, NULL_RTX, address_mode, EXPAND_NORMAL)
tree addr_base = NULL_TREE, addr_off = NULL_TREE;
if (sym)
- addr_base = fold_convert (type, build_addr (sym, current_function_decl));
- else if (base && POINTER_TYPE_P (TREE_TYPE (base)))
+ addr_base = fold_convert (type, sym);
+ else if (base)
{
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (base)));
addr_base = fold_convert (type, base);
base = NULL_TREE;
}
tree base;
gcc_assert (!addr->symbol ^ !addr->base);
if (addr->symbol)
- base = build_fold_addr_expr (addr->symbol);
+ base = addr->symbol;
else
base = addr->base;
return fold_build2 (MEM_REF, type, base, addr->offset);
if (i == addr->n)
return;
- parts->symbol = TREE_OPERAND (val, 0);
+ parts->symbol = val;
aff_combination_remove_elt (addr, i);
}
if (parts.symbol)
{
- tmp = build_addr (parts.symbol, current_function_decl);
+ tmp = parts.symbol;
gcc_assert (is_gimple_val (tmp));
/* Add the symbol to base, eventually forcing it to register. */
if (parts->symbol)
{
fprintf (file, "symbol: ");
- print_generic_expr (file, parts->symbol, TDF_SLIM);
+ print_generic_expr (file, TREE_OPERAND (parts->symbol, 0), TDF_SLIM);
fprintf (file, "\n");
}
if (parts->base)
if (TREE_CODE (base1) == TARGET_MEM_REF)
{
- if (TMR_BASE (base1))
+ if (TMR_SYMBOL (base1))
+ ptr1 = TMR_SYMBOL (base1);
+ else if (TMR_BASE (base1))
{
if (!POINTER_TYPE_P (TREE_TYPE (TMR_BASE (base1))))
return true;
ptr1 = TMR_BASE (base1);
}
- else if (TMR_SYMBOL (base1))
- ptr1 = build_fold_addr_expr (TMR_SYMBOL (base1));
else
return true;
}
if (TREE_CODE (base1) == TARGET_MEM_REF)
{
- if (TMR_BASE (base1))
+ if (TMR_SYMBOL (base1))
+ ptr1 = TMR_SYMBOL (base1);
+ else if (TMR_BASE (base1))
{
if (!POINTER_TYPE_P (TREE_TYPE (TMR_BASE (base1))))
return true;
ptr1 = TMR_BASE (base1);
}
- else if (TMR_SYMBOL (base1))
- ptr1 = build_fold_addr_expr (TMR_SYMBOL (base1));
else
return true;
}
if (TREE_CODE (base2) == TARGET_MEM_REF)
{
- if (TMR_BASE (base2))
+ if (TMR_SYMBOL (base2))
+ ptr2 = TMR_SYMBOL (base2);
+ else if (TMR_BASE (base2))
{
if (!POINTER_TYPE_P (TREE_TYPE (TMR_BASE (base2))))
return true;
ptr2 = TMR_BASE (base2);
}
- else if (TMR_SYMBOL (base2))
- ptr2 = build_fold_addr_expr (TMR_SYMBOL (base2));
else
return true;
}
get_expr_operands (stmt, &TMR_INDEX (expr), opf_use | (flags & opf_no_vops));
if (TMR_SYMBOL (expr))
- mark_address_taken (TMR_SYMBOL (expr));
+ mark_address_taken (TREE_OPERAND (TMR_SYMBOL (expr), 0));
add_virtual_operand (stmt, flags);
}
generated by the builtin targetm.vectorize.mask_for_load_builtin_decl. */
DEFTREECODE (REALIGN_LOAD_EXPR, "realign_load", tcc_expression, 3)
-/* Low-level memory addressing. Operands are SYMBOL (static or global
- variable), BASE (register), INDEX (register), STEP (integer constant),
+/* Low-level memory addressing. Operands are SYMBOL (address of static or
+ global variable), BASE (register), INDEX (register), STEP (integer constant),
OFFSET (integer constant). Corresponding address is
SYMBOL + BASE + STEP * INDEX + OFFSET. Only variations and values valid on
the target are allowed.