Commit ac182688 by Zdenek Dvorak Committed by Zdenek Dvorak

tree-ssa-address.c: New file.

	* tree-ssa-address.c: New file.
	* Makefile.in (tree-ssa-address.o): Add.
	* expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on
	INDIRECT_REFs.  Handle TARGET_MEM_REFs.
	* tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs.
	* tree-flow.h (struct mem_address): New.
	(struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c.
	(create_mem_ref, addr_for_mem_ref, get_address_description,
	maybe_fold_tmr, multiplier_allowed_in_address_p,
	multiply_by_cost):  Declare.
	* tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs.
	* tree-pretty-print.c (dump_generic_node): Ditto.
	* tree-ssa-loop-im.c (for_each_index): Ditto.
	* tree-ssa-loop-ivopts.c (may_be_unaligned_p,
	find_interesting_uses_address): Ditto.
	(rewrite_address_base, build_addr_strip_iref): Removed.
	(struct affine_tree_combination): Moved to tree-flow.h.
	(get_ref_tag, copy_ref_info): New functions.
	(rewrite_use_address): Produce TARGET_MEM_REFs.
	(tree_ssa_iv_optimize): Do not call update_ssa
	and rewrite_into_loop_closed_ssa.
	(tree_to_aff_combination): Use build_fold_addr_expr instead of
	build_addr_strip_iref.
	(unshare_aff_combination): New function.
	(fold_affine_sum): Removed.
	(get_computation_at): Use get_computation_aff.  Unshare the result.
	(get_computation_aff, multiplier_allowed_in_address_p): New function.
	(multiply_by_cost): Exported.
	(get_address_cost): Use multiplier_allowed_in_address_p.
	* tree-ssa-operands.c (get_tmr_operands): New function.
	(get_expr_operands): Handle TARGET_MEM_REFs.
	* tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs.
	(build): Handle 7 arguments.
	(build7_stat): New function.
	* tree.def (TARGET_MEM_DEF): New.
	* tree.h (REF_ORIGINAL): Removed.
	(TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL,
	TMR_TAG, build7): New macros.
	(build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare.
	* tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr.
	* doc/c-tree.texi: Document TARGET_MEM_REF.
	* doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar.

	* gcc.dg/tree-ssa/loop-2.c: Update outcome.
	* gcc.dg/tree-ssa/loop-3.c: Update outcome.
	* gcc.dg/tree-ssa/loop-4.c: Update outcome.
	* gcc.dg/tree-ssa/loop-9.c: New test.

From-SVN: r100708
parent 01ea1ea8
2005-06-07 Zdenek Dvorak <dvorakz@suse.cz>
* tree-ssa-address.c: New file.
* Makefile.in (tree-ssa-address.o): Add.
* expr.c (expand_expr_real_1): Do not handle REF_ORIGINAL on
INDIRECT_REFs. Handle TARGET_MEM_REFs.
* tree-eh.c (tree_could_trap_p): Handle TARGET_MEM_REFs.
* tree-flow.h (struct mem_address): New.
(struct affine_tree_combination): Moved from tree-ssa-loop-ivopts.c.
(create_mem_ref, addr_for_mem_ref, get_address_description,
maybe_fold_tmr, multiplier_allowed_in_address_p,
multiply_by_cost): Declare.
* tree-mudflap.c (mf_xform_derefs_1): Handle TARGET_MEM_REFs.
* tree-pretty-print.c (dump_generic_node): Ditto.
* tree-ssa-loop-im.c (for_each_index): Ditto.
* tree-ssa-loop-ivopts.c (may_be_unaligned_p,
find_interesting_uses_address): Ditto.
(rewrite_address_base, build_addr_strip_iref): Removed.
(struct affine_tree_combination): Moved to tree-flow.h.
(get_ref_tag, copy_ref_info): New functions.
(rewrite_use_address): Produce TARGET_MEM_REFs.
(tree_ssa_iv_optimize): Do not call update_ssa
and rewrite_into_loop_closed_ssa.
(tree_to_aff_combination): Use build_fold_addr_expr instead of
build_addr_strip_iref.
(unshare_aff_combination): New function.
(fold_affine_sum): Removed.
(get_computation_at): Use get_computation_aff. Unshare the result.
(get_computation_aff, multiplier_allowed_in_address_p): New function.
(multiply_by_cost): Exported.
(get_address_cost): Use multiplier_allowed_in_address_p.
* tree-ssa-operands.c (get_tmr_operands): New function.
(get_expr_operands): Handle TARGET_MEM_REFs.
* tree.c (copy_node_stat): Copy annotations for TARGET_MEM_REFs.
(build): Handle 7 arguments.
(build7_stat): New function.
* tree.def (TARGET_MEM_DEF): New.
* tree.h (REF_ORIGINAL): Removed.
(TMR_SYMBOL, TMR_BASE, TMR_INDEX, TMR_STEP, TMR_OFFSET, TMR_ORIGINAL,
TMR_TAG, build7): New macros.
(build7_stat, tree_mem_ref_addr, copy_mem_ref_info): Declare.
* tree-ssa-ccp.c (fold_stmt_r): Call maybe_fold_tmr.
* doc/c-tree.texi: Document TARGET_MEM_REF.
* doc/tree-ssa.texi: Add TARGET_MEM_REF to gimple grammar.
2005-06-07 Jakub Jelinek <jakub@redhat.com>
PR debug/21946
......
......@@ -684,7 +684,7 @@ CONFIG_H = config.h $(host_xm_file_list)
TCONFIG_H = tconfig.h $(xm_file_list)
TM_P_H = tm_p.h $(tm_p_file_list)
GTM_H = tm.h $(tm_file_list)
TM_H = $(GTM_H) insn-constants.h insn-flags.h
TM_H = $(GTM_H) insn-constants.h insn-flags.h options.h
# Variables for version information.
BASEVER := $(srcdir)/BASE-VER # 4.x.y
......@@ -935,7 +935,8 @@ OBJS-common = \
tree-vect-generic.o tree-ssa-loop.o tree-ssa-loop-niter.o \
tree-ssa-loop-manip.o tree-ssa-threadupdate.o \
tree-vectorizer.o tree-vect-analyze.o tree-vect-transform.o \
tree-ssa-loop-ivcanon.o tree-ssa-propagate.o tree-ssa-math-opts.o \
tree-ssa-loop-ivcanon.o tree-ssa-propagate.o tree-ssa-address.o \
tree-ssa-math-opts.o \
tree-ssa-loop-ivopts.o tree-if-conv.o tree-ssa-loop-unswitch.o \
alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \
......@@ -1801,6 +1802,11 @@ tree-ssa-loop-unswitch.o : tree-ssa-loop-unswitch.c $(TREE_FLOW_H) \
$(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \
domwalk.h $(PARAMS_H) output.h $(DIAGNOSTIC_H) $(TIMEVAR_H) $(TM_H) \
coretypes.h $(TREE_DUMP_H) tree-pass.h $(BASIC_BLOCK_H) hard-reg-set.h
tree-ssa-address.o : tree-ssa-address.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) \
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
tree-pass.h $(FLAGS_H) tree-inline.h $(RECOG_H) insn-config.h $(EXPR_H) \
gt-tree-ssa-address.h $(GGC_H)
tree-ssa-loop-niter.o : tree-ssa-loop-niter.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) \
tree-inline.h output.h $(DIAGNOSTIC_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
......@@ -2622,7 +2628,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/stringpool.c $(srcdir)/tree.c $(srcdir)/varasm.c \
$(srcdir)/tree-mudflap.c $(srcdir)/tree-flow.h \
$(srcdir)/c-objc-common.c $(srcdir)/c-common.c $(srcdir)/c-parser.c \
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c \
$(srcdir)/tree-ssanames.c $(srcdir)/tree-eh.c $(srcdir)/tree-ssa-address.c \
$(srcdir)/tree-phinodes.c $(srcdir)/tree-cfg.c \
$(srcdir)/tree-dfa.c $(srcdir)/tree-ssa-propagate.c \
$(srcdir)/tree-iterator.c $(srcdir)/gimplify.c \
......@@ -2645,7 +2651,8 @@ gt-expr.h gt-sdbout.h gt-optabs.h gt-bitmap.h gt-dojump.h \
gt-dwarf2out.h gt-reg-stack.h gt-dwarf2asm.h \
gt-dbxout.h gt-c-common.h gt-c-decl.h gt-c-parser.h \
gt-c-pragma.h gtype-c.h gt-cfglayout.h \
gt-tree-mudflap.h gt-tree-vect-generic.h gt-tree-profile.h \
gt-tree-mudflap.h gt-tree-vect-generic.h \
gt-tree-profile.h gt-tree-ssa-address.h \
gt-tree-ssanames.h gt-tree-iterator.h gt-gimplify.h \
gt-tree-phinodes.h gt-tree-nested.h \
gt-tree-ssa-operands.h gt-tree-ssa-propagate.h \
......
......@@ -1712,6 +1712,7 @@ This macro returns the attributes on the type @var{type}.
@tindex EXACT_DIV_EXPR
@tindex ARRAY_REF
@tindex ARRAY_RANGE_REF
@tindex TARGET_MEM_REF
@tindex LT_EXPR
@tindex LE_EXPR
@tindex GT_EXPR
......@@ -2103,6 +2104,26 @@ meanings. The type of these expressions must be an array whose component
type is the same as that of the first operand. The range of that array
type determines the amount of data these expressions access.
@item TARGET_MEM_REF
These nodes represent memory accesses whose address directly map to
an addressing mode of the target architecture. The first argument
is @code{TMR_SYMBOL} and must be a @code{VAR_DECL} of an object with
a fixed address. The second argument is @code{TMR_BASE} and the
third one is @code{TMR_INDEX}. The fourth argument is
@code{TMR_STEP} and must be an @code{INTEGER_CST}. The fifth
argument is @code{TMR_OFFSET} and must be an @code{INTEGER_CST}.
Any of the arguments may be NULL if the appropriate component
does not appear in the address. Address of the @code{TARGET_MEM_REF}
is determined in the following way.
@smallexample
&TMR_SYMBOL + TMR_BASE + TMR_INDEX * TMR_STEP + TMR_OFFSET
@end smallexample
The sixth argument is the reference to the original memory access, which
is preserved for the purposes of the RTL alias analysis. The seventh
argument is a tag representing the results of tree level alias analysis.
@item LT_EXPR
@itemx LE_EXPR
@itemx GT_EXPR
......
......@@ -632,6 +632,12 @@ void f()
op2 -> var
compref : inner-compref
| TARGET_MEM_REF
op0 -> ID
op1 -> val
op2 -> val
op3 -> CONST
op4 -> CONST
| REALPART_EXPR
op0 -> inner-compref
| IMAGPART_EXPR
......
......@@ -6862,7 +6862,6 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
case INDIRECT_REF:
{
tree exp1 = TREE_OPERAND (exp, 0);
tree orig;
if (modifier != EXPAND_WRITE)
{
......@@ -6885,10 +6884,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
temp = gen_rtx_MEM (mode, op0);
orig = REF_ORIGINAL (exp);
if (!orig)
orig = exp;
set_mem_attributes (temp, orig, 0);
set_mem_attributes (temp, exp, 0);
/* Resolve the misalignment now, so that we don't have to remember
to resolve it later. Of course, this only works for reads. */
......@@ -6920,6 +6916,18 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
return temp;
}
case TARGET_MEM_REF:
{
struct mem_address addr;
get_address_description (exp, &addr);
op0 = addr_for_mem_ref (&addr, true);
op0 = memory_address (mode, op0);
temp = gen_rtx_MEM (mode, op0);
set_mem_attributes (temp, TMR_ORIGINAL (exp), 0);
}
return temp;
case ARRAY_REF:
{
......
2005-06-07 Zdenek Dvorak <dvorakz@suse.cz>
* gcc.dg/tree-ssa/loop-2.c: Update outcome.
* gcc.dg/tree-ssa/loop-3.c: Update outcome.
* gcc.dg/tree-ssa/loop-4.c: Update outcome.
* gcc.dg/tree-ssa/loop-9.c: New test.
2005-06-07 Nathan Sidwell <nathan@codesourcery.com>
* g++.dg/parse/defarg10.C: New.
......
......@@ -21,9 +21,12 @@ void xxx(void)
arr_base[iter].y = 17 * iter;
}
/* Access to arr_base[iter].y should be strength reduced. */
/* Access to arr_base[iter].y should be strength reduced, i.e., there should
be no multiplication. */
/* { dg-final { scan-tree-dump-times "arr_base\[^\\n\\r\]*=" 0 "vars" } } */
/* { dg-final { scan-tree-dump-times " \\* \[^\\n\\r\]*=" 0 "vars" } } */
/* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "vars" } } */
/* { dg-final { scan-tree-dump-times "MEM" 1 "vars" } } */
/* 17 * iter should be strength reduced. */
......
......@@ -20,7 +20,8 @@ void xxx(void)
/* Access to arr_base[iter].y should not be strength reduced, since
we have a memory mode including multiplication by 4. */
/* { dg-final { scan-tree-dump-times "arr_base.*=" 1 "vars" } } */
/* { dg-final { scan-tree-dump-times "MEM" 1 "vars" } } */
/* { dg-final { scan-tree-dump-times "step:" 1 "vars" } } */
/* And original induction variable should be preserved. */
......
......@@ -32,9 +32,11 @@ void xxx(void)
-- induction variable with base 0, the memory access of form
*(iv + &arr_base[0].y) = ...
In any case, we should not have 'arr_base[.*] =' */
In any case, we should not have any multiplication. */
/* { dg-final { scan-tree-dump-times "arr_base\[.*\]\.y =" 0 "vars" } } */
/* { dg-final { scan-tree-dump-times " \\* \[^\\n\\r\]*=" 0 "vars" } } */
/* { dg-final { scan-tree-dump-times "\[^\\n\\r\]*= \\* " 0 "vars" } } */
/* { dg-final { scan-tree-dump-times "MEM" 1 "vars" } } */
/* And the original induction variable should be eliminated. */
......
/* Without TARGET_MEM_REFs, dom creates code like
i1 = 4 * i;
*(p + i1) = i;
*(p + i1 + 4) = i
causing us to have unnecessary multiplication by 4 in the
result. */
/* { dg-do compile } */
/* { dg-options "-O1" } */
void foo (int *p)
{
int i;
for (i = 0; i < 100; i++)
{
p[i] = i;
p[i + 1] = i;
}
}
/* { dg-final { scan-assembler-times "lea" 0 { target i?86-*-* x86_64-*-* } } } */
......@@ -185,7 +185,6 @@ create_stmt_ann (tree t)
return ann;
}
/* Create a new annotation for a tree T. */
tree_ann_t
......
......@@ -1869,6 +1869,13 @@ tree_could_trap_p (tree expr)
restart:
switch (code)
{
case TARGET_MEM_REF:
/* For TARGET_MEM_REFs use the information based on the original
reference. */
expr = TMR_ORIGINAL (expr);
code = TREE_CODE (expr);
goto restart;
case COMPONENT_REF:
case REALPART_EXPR:
case IMAGPART_EXPR:
......
......@@ -66,7 +66,6 @@ get_stmt_ann (tree stmt)
return (ann) ? ann : create_stmt_ann (stmt);
}
/* Return the annotation type for annotation ANN. */
static inline enum tree_ann_type
ann_type (tree_ann_t ann)
......
......@@ -736,7 +736,9 @@ void insert_edge_copies (tree, basic_block);
extern void linear_transform_loops (struct loops *);
/* In tree-ssa-loop-ivopts.c */
extern bool expr_invariant_in_loop_p (struct loop *, tree);
bool expr_invariant_in_loop_p (struct loop *, tree);
bool multiplier_allowed_in_address_p (HOST_WIDE_INT);
unsigned multiply_by_cost (HOST_WIDE_INT, enum machine_mode);
/* In tree-ssa-threadupdate.c. */
extern bool thread_through_all_blocks (bitmap);
......@@ -745,6 +747,48 @@ extern bool thread_through_all_blocks (bitmap);
tree force_gimple_operand (tree, tree *, bool, tree);
tree force_gimple_operand_bsi (block_stmt_iterator *, tree, bool, tree);
/* In tree-ssa-address.c */
/* Affine combination of trees. We keep track of at most MAX_AFF_ELTS elements
to make things simpler; this is sufficient in most cases. */
#define MAX_AFF_ELTS 8
struct affine_tree_combination
{
/* Type of the result of the combination. */
tree type;
/* Mask modulo that the operations are performed. */
unsigned HOST_WIDE_INT mask;
/* Constant offset. */
unsigned HOST_WIDE_INT offset;
/* Number of elements of the combination. */
unsigned n;
/* Elements and their coefficients. */
tree elts[MAX_AFF_ELTS];
unsigned HOST_WIDE_INT coefs[MAX_AFF_ELTS];
/* Remainder of the expression. */
tree rest;
};
/* Description of a memory address. */
struct mem_address
{
tree symbol, base, index, step, offset;
};
tree create_mem_ref (block_stmt_iterator *, tree,
struct affine_tree_combination *);
rtx addr_for_mem_ref (struct mem_address *, bool);
void get_address_description (tree, struct mem_address *);
tree maybe_fold_tmr (tree);
#include "tree-flow-inline.h"
#endif /* _TREE_FLOW_H */
......@@ -835,6 +835,14 @@ mf_xform_derefs_1 (block_stmt_iterator *iter, tree *tp,
integer_one_node));
break;
case TARGET_MEM_REF:
addr = tree_mem_ref_addr (ptr_type_node, t);
base = addr;
limit = fold_build2 (MINUS_EXPR, ptr_type_node,
fold_build2 (PLUS_EXPR, ptr_type_node, base, size),
build_int_cst_type (ptr_type_node, 1));
break;
case ARRAY_RANGE_REF:
warning (0, "mudflap checking not yet implemented for ARRAY_RANGE_REF");
return;
......
......@@ -443,6 +443,64 @@ dump_generic_node (pretty_printer *buffer, tree node, int spc, int flags,
pp_string (buffer, "::");
break;
case TARGET_MEM_REF:
{
const char *sep = "";
tree tmp;
pp_string (buffer, "MEM[");
tmp = TMR_SYMBOL (node);
if (tmp)
{
pp_string (buffer, sep);
sep = ", ";
pp_string (buffer, "symbol: ");
dump_generic_node (buffer, tmp, spc, flags, false);
}
tmp = TMR_BASE (node);
if (tmp)
{
pp_string (buffer, sep);
sep = ", ";
pp_string (buffer, "base: ");
dump_generic_node (buffer, tmp, spc, flags, false);
}
tmp = TMR_INDEX (node);
if (tmp)
{
pp_string (buffer, sep);
sep = ", ";
pp_string (buffer, "index: ");
dump_generic_node (buffer, tmp, spc, flags, false);
}
tmp = TMR_STEP (node);
if (tmp)
{
pp_string (buffer, sep);
sep = ", ";
pp_string (buffer, "step: ");
dump_generic_node (buffer, tmp, spc, flags, false);
}
tmp = TMR_OFFSET (node);
if (tmp)
{
pp_string (buffer, sep);
sep = ", ";
pp_string (buffer, "offset: ");
dump_generic_node (buffer, tmp, spc, flags, false);
}
pp_string (buffer, "]");
if (flags & TDF_DETAILS)
{
pp_string (buffer, "{");
dump_generic_node (buffer, TMR_ORIGINAL (node), spc, flags,
false);
pp_string (buffer, "}");
}
}
break;
case ARRAY_TYPE:
{
tree tmp;
......
......@@ -1874,7 +1874,6 @@ maybe_fold_stmt_addition (tree expr)
return t;
}
/* Subroutine of fold_stmt called via walk_tree. We perform several
simplifications of EXPR_P, mostly having to do with pointer arithmetic. */
......@@ -1948,6 +1947,10 @@ fold_stmt_r (tree *expr_p, int *walk_subtrees, void *data)
}
break;
case TARGET_MEM_REF:
t = maybe_fold_tmr (expr);
break;
default:
return NULL_TREE;
}
......
......@@ -204,6 +204,17 @@ for_each_index (tree *addr_p, bool (*cbck) (tree, tree *, void *), void *data)
case VECTOR_CST:
return true;
case TARGET_MEM_REF:
idx = &TMR_BASE (*addr_p);
if (*idx
&& !cbck (*addr_p, idx, data))
return false;
idx = &TMR_INDEX (*addr_p);
if (*idx
&& !cbck (*addr_p, idx, data))
return false;
return true;
default:
gcc_unreachable ();
}
......
......@@ -152,6 +152,7 @@ static void note_addressable (tree, stmt_ann_t);
static void get_expr_operands (tree, tree *, int);
static void get_asm_expr_operands (tree);
static void get_indirect_ref_operands (tree, tree, int);
static void get_tmr_operands (tree, tree, int);
static void get_call_expr_operands (tree, tree);
static inline void append_def (tree *);
static inline void append_use (tree *);
......@@ -1289,6 +1290,10 @@ get_expr_operands (tree stmt, tree *expr_p, int flags)
get_indirect_ref_operands (stmt, expr, flags);
return;
case TARGET_MEM_REF:
get_tmr_operands (stmt, expr, flags);
return;
case ARRAY_REF:
case ARRAY_RANGE_REF:
/* Treat array references as references to the virtual variable
......@@ -1672,6 +1677,30 @@ get_indirect_ref_operands (tree stmt, tree expr, int flags)
get_expr_operands (stmt, pptr, opf_none);
}
/* A subroutine of get_expr_operands to handle TARGET_MEM_REF. */
static void
get_tmr_operands (tree stmt, tree expr, int flags)
{
tree tag = TMR_TAG (expr);
/* First record the real operands. */
get_expr_operands (stmt, &TMR_BASE (expr), opf_none);
get_expr_operands (stmt, &TMR_INDEX (expr), opf_none);
/* MEM_REFs should never be killing. */
flags &= ~opf_kill_def;
if (TMR_SYMBOL (expr))
note_addressable (TMR_SYMBOL (expr), stmt_ann (stmt));
if (tag)
add_stmt_operand (&tag, stmt_ann (stmt), flags);
else
/* Something weird, so ensure that we will be careful. */
stmt_ann (stmt)->has_volatile_ops = true;
}
/* A subroutine of get_expr_operands to handle CALL_EXPR. */
static void
......
......@@ -2739,12 +2739,41 @@ build4_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
return t;
}
tree
build7_stat (enum tree_code code, tree tt, tree arg0, tree arg1,
tree arg2, tree arg3, tree arg4, tree arg5,
tree arg6 MEM_STAT_DECL)
{
bool constant, read_only, side_effects, invariant;
tree t;
gcc_assert (code == TARGET_MEM_REF);
t = make_node_stat (code PASS_MEM_STAT);
TREE_TYPE (t) = tt;
side_effects = TREE_SIDE_EFFECTS (t);
PROCESS_ARG(0);
PROCESS_ARG(1);
PROCESS_ARG(2);
PROCESS_ARG(3);
PROCESS_ARG(4);
PROCESS_ARG(5);
PROCESS_ARG(6);
TREE_SIDE_EFFECTS (t) = side_effects;
TREE_THIS_VOLATILE (t) = 0;
return t;
}
/* Backup definition for non-gcc build compilers. */
tree
(build) (enum tree_code code, tree tt, ...)
{
tree t, arg0, arg1, arg2, arg3;
tree t, arg0, arg1, arg2, arg3, arg4, arg5, arg6;
int length = TREE_CODE_LENGTH (code);
va_list p;
......@@ -2776,6 +2805,16 @@ tree
arg3 = va_arg (p, tree);
t = build4 (code, tt, arg0, arg1, arg2, arg3);
break;
case 7:
arg0 = va_arg (p, tree);
arg1 = va_arg (p, tree);
arg2 = va_arg (p, tree);
arg3 = va_arg (p, tree);
arg4 = va_arg (p, tree);
arg5 = va_arg (p, tree);
arg6 = va_arg (p, tree);
t = build7 (code, tt, arg0, arg1, arg2, arg3, arg4, arg5, arg6);
break;
default:
gcc_unreachable ();
}
......
......@@ -935,6 +935,18 @@ DEFTREECODE (WITH_SIZE_EXPR, "with_size_expr", tcc_expression, 2)
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),
OFFSET (integer constant). Corresponding address is
SYMBOL + BASE + STEP * INDEX + OFFSET. Only variations and values valid on
the target are allowed.
The sixth argument is the reference to the original memory access, which
is preserved for the purposes of the RTL alias analysis. The seventh
argument is a tag representing results of the tree level alias analysis. */
DEFTREECODE (TARGET_MEM_REF, "target_mem_ref", tcc_reference, 7)
/*
Local variables:
mode:c
......
......@@ -1171,10 +1171,6 @@ struct tree_vec GTY(())
#define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
#define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
/* In INDIRECT_REF, ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF. */
#define REF_ORIGINAL(NODE) TREE_CHAIN (TREE_CHECK3 (NODE, \
INDIRECT_REF, ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF))
/* In a LOOP_EXPR node. */
#define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
......@@ -1240,6 +1236,15 @@ struct tree_vec GTY(())
#define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1)
#define CASE_LABEL(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2)
/* The operands of a TARGET_MEM_REF. */
#define TMR_SYMBOL(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 0))
#define TMR_BASE(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 1))
#define TMR_INDEX(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 2))
#define TMR_STEP(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 3))
#define TMR_OFFSET(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 4))
#define TMR_ORIGINAL(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 5))
#define TMR_TAG(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 6))
/* The operands of a BIND_EXPR. */
#define BIND_EXPR_VARS(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 0))
#define BIND_EXPR_BODY(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 1))
......@@ -2897,6 +2902,10 @@ extern tree build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
extern tree build4_stat (enum tree_code, tree, tree, tree, tree,
tree MEM_STAT_DECL);
#define build4(c,t1,t2,t3,t4,t5) build4_stat (c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
extern tree build7_stat (enum tree_code, tree, tree, tree, tree, tree,
tree, tree, tree MEM_STAT_DECL);
#define build7(c,t1,t2,t3,t4,t5,t6,t7,t8) \
build7_stat (c,t1,t2,t3,t4,t5,t6,t7,t8 MEM_STAT_INFO)
extern tree build_int_cst (tree, HOST_WIDE_INT);
extern tree build_int_cst_type (tree, HOST_WIDE_INT);
......@@ -3990,4 +3999,8 @@ extern tree get_base_address (tree t);
/* In tree-vectorizer.c. */
extern void vect_set_verbosity_level (const char *);
/* In tree-ssa-address.c. */
extern tree tree_mem_ref_addr (tree, tree);
extern void copy_mem_ref_info (tree, tree);
#endif /* GCC_TREE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment