+2004-08-19 Eric Christopher <echristo@redhat.com>
+
+ * langhooks-def.h (LANG_HOOKS_UNSAVE_EXPR_NOW): Remove.
+ * langhooks.h (unsave_expr_now): Ditto.
+ * tree.h (unsave_expr_1): Remove prototype.
+ (lhd_unsave_expr_now): Rename to unsave_expr_now.
+ * tree-inline.c (unsave_expr_1): Move here
+ from tree.c. Make static.
+ (unsave_expr_now): Rename from lhd_unsave_expr_now.
+ * tree-sra.c: Fix up for rename.
+ * tree-ssa-copy.c: Ditto.
+ * tree-eh.c: Ditto.
+ * tree.c (unsave_expr_1): Move to tree-inline.c.
+
2004-08-19 Caroline Tice <ctice@apple.com>
* config/i386/cygming.h (switch_to_section): Fix typo (change
in_unlikely_text_section to in_unlikely_executed_text).
-
+
2004-08-19 Daniel Berlin <dberlin@dberlin.org>
* vec.h (VEC_lower_bound): New macro.
-
+
2004-08-19 Richard Sandiford <rsandifo@redhat.com>
PR target/16446
* params.def (PARAM_INTEGER_SHARE_LIMIT): New.
* params.h (INTEGER_SHARE_LIMIT): New.
* Makefile.in (tree.o, stor-layout.o): Depend on PARAMS_H.
-
+
2004-08-19 Paolo Bonzini <bonzini@gnu.org>
* gimplify.c (gimplify_minimax_expr): Remove.
2004-08-19 Dorit Naishlos <dorit@il.ibm.com>
- * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace
+ * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace
STACK_BOUDARY with PREFERRED_STACK_BOUNDARY.
2004-08-19 Mark Mitchell <mark@codesourcery.com>
(divsf3+1, divsf3+2): Change type to frdiv.
* config/mips/sb1.md (ir_sb1_recipsf_2pipes, ir_sb1_recipsf_1pipe,
ir_sb1_recipdf_2pipes, ir_sb1_recipdf_1pipe): New.
-
+
* config/mips/3000.md (r3k_fdiv_single, r3k_fdiv_double): Add frdiv.
* config/mips/4300.md (r4300_fdiv_single, r4300_fdiv_double): Likewise.
* config/mips/4600.md (r4600_fdiv_single, f4600_fdiv_double): Likewise.
* config/i386/xmmintrin.h: Include <mm_malloc.h>.
2004-08-03 H.J. Lu <hongjiu.lu@intel.com>
- Tanguy FautrÃ\83 <tfautre@pandora.be>
+ Tanguy FautrÃ? <tfautre@pandora.be>
* config/i386/pmm_malloc.h: New file.
+2004-08-19 Eric Christopher <echristo@redhat.com>
+
+ * cp-tree.h (cxx_unsave_expr_now): Delete prototype.
+ * tree.c (cxx_unsave_expr_now): Delete.
+ (cp_unsave_r): Ditto.
+
2004-08-19 Mark Mitchell <mark@codesourcery.com>
PR c++/15890
* decl.c (finish_enum): Do not copy value node early, copy
later.
* lex.c (cxx_init): Force null_node to be unique.
-
+
2004-08-19 Joseph S. Myers <jsm@polyomino.org.uk>
PR c++/17041
PR c++/16929
* pt.c (tsubst_default_argument): Clear out current_class_ptr and
current_class_ref while tsubsting.
-
+
2004-08-10 Mark Mitchell <mark@codesourcery.com>
PR c++/16971
static_dtors to ...
(expand_or_defer_fn): ... here.
* tree.c (no_linkage_check): Add relaxed_p parameter.
-
+
2004-07-28 Eric Christopher <echristo@redhat.com>
* cp-lang.c (LANG_HOOKS_UNSAFE_FOR_REEVAL): Delete.
of the base class.
The BV_VCALL_INDEX of each node, if non-NULL, gives the vtable
- index of the vcall offset for this entry.
+ index of the vcall offset for this entry.
The BV_FN is the declaration for the virtual function itself.
a TEMPLATE_DECL, an OVERLOAD, or a TEMPLATE_ID_EXPR. */
#define BASELINK_FUNCTIONS(NODE) \
(((struct tree_baselink*) BASELINK_CHECK (NODE))->functions)
-/* The BINFO in which the search for the functions indicated by this baselink
- began. This base is used to determine the accessibility of functions
+/* The BINFO in which the search for the functions indicated by this baselink
+ began. This base is used to determine the accessibility of functions
selected by overload resolution. */
#define BASELINK_ACCESS_BINFO(NODE) \
(((struct tree_baselink*) BASELINK_CHECK (NODE))->access_binfo)
struct lang_type_class GTY(())
{
struct lang_type_header h;
-
+
unsigned char align;
unsigned has_mutable : 1;
struct lang_type GTY(())
{
- union lang_type_u
+ union lang_type_u
{
struct lang_type_header GTY((skip (""))) h;
struct lang_type_class GTY((tag ("1"))) c;
#define CLASSTYPE_ALIGN_UNIT(NODE) \
(CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT)
-/* True if this a Java interface type, declared with
+/* True if this a Java interface type, declared with
'__attribute__ ((java_interface))'. */
#define TYPE_JAVA_INTERFACE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->java_interface)
union lang_decl_u4
{
- struct full_lang_decl
+ struct full_lang_decl
{
/* For a non-thunk function decl, this is a tree list of
friendly classes. For a thunk function decl, it is the
thunked to function decl. */
tree befriending_classes;
-
+
/* For a non-virtual FUNCTION_DECL, this is
DECL_FRIEND_CONTEXT. For a virtual FUNCTION_DECL for which
DECL_THIS_THUNK_P does not hold, this is DECL_THUNKS. Both
/* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */
tree cloned_function;
-
+
/* In a FUNCTION_DECL for which THUNK_P holds, this is
THUNK_FIXED_OFFSET. */
HOST_WIDE_INT fixed_offset;
unsigned u3sel : 1;
unsigned pending_inline_p : 1;
-
+
union lang_decl_u3
{
- struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields")))
+ struct sorted_fields_type * GTY ((tag ("0"), reorder ("resort_sorted_fields")))
sorted_fields;
struct cp_token_cache * GTY ((tag ("2"))) pending_inline_info;
- struct language_function * GTY ((tag ("1")))
+ struct language_function * GTY ((tag ("1")))
saved_language_function;
} GTY ((desc ("%1.u3sel + %1.pending_inline_p"))) u;
} GTY ((tag ("1"))) f;
declaration. Some entities (like a member function in a local
class, or a local variable) do not have linkage at all, and this
macro should not be used in those cases.
-
+
Implementation note: A FUNCTION_DECL without DECL_LANG_SPECIFIC was
created by language-independent code, and has C linkage. Most
VAR_DECLs have C++ linkage, and do not have DECL_LANG_SPECIFIC, but
/* Perform an action for each clone of FN, if FN is a function with
clones. This macro should be used like:
-
+
FOR_EACH_CLONE (clone, fn)
{ ... }
(TREE_LANG_FLAG_2 (VAR_DECL_CHECK (NODE)))
/* Nonzero for a VAR_DECL that can be used in an integral constant
- expression.
+ expression.
[expr.const]
An integral constant-expression can only involve ... const
variables of static or enumeration types initialized with
constant expressions ...
-
+
The standard does not require that the expression be non-volatile.
G++ implements the proposed correction in DR 457. */
#define DECL_INTEGRAL_CONSTANT_VAR_P(NODE) \
function, (or be implemented via passing some invisible parameter
to the thunked function, which is modified to perform the
adjustment just before returning).
-
+
A thunk may perform either, or both, of the following operations:
o Adjust the this or result pointer by a constant offset.
#define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2)
/* An enumeration of the kind of tags that C++ accepts. */
-enum tag_types {
+enum tag_types {
none_type = 0, /* Not a tag type. */
record_type, /* "struct" types. */
class_type, /* "class" types. */
sfk_conversion /* A conversion operator. */
} special_function_kind;
-/* The various kinds of linkage. From [basic.link],
-
+/* The various kinds of linkage. From [basic.link],
+
A name is said to have linkage when it might denote the same
object, reference, function, type, template, namespace or value
as a name introduced in another scope:
extern void insert_block (tree);
extern tree pushdecl (tree);
extern void cxx_init_decl_processing (void);
-enum cp_tree_node_structure_enum cp_tree_node_structure
+enum cp_tree_node_structure_enum cp_tree_node_structure
(union lang_tree_node *);
extern bool cxx_mark_addressable (tree);
extern void cxx_push_function_context (struct function *);
extern void qualified_name_lookup_error (tree, tree, tree);
extern tree finish_id_expression (tree, tree, tree,
cp_id_kind *, tree *,
- bool, bool, bool *,
+ bool, bool, bool *,
const char **);
extern tree finish_typeof (tree);
extern void finish_decl_cleanup (tree, tree);
extern tree stabilize_expr (tree, tree *);
extern void stabilize_call (tree, tree *);
extern bool stabilize_init (tree, tree *);
-extern tree cxx_unsave_expr_now (tree);
extern tree cxx_maybe_build_cleanup (tree);
extern void init_tree (void);
extern int pod_type_p (tree);
extern tree build_array_ref (tree, tree);
extern tree get_member_function_from_ptrfunc (tree *, tree);
extern tree convert_arguments (tree, tree, tree, int);
-extern tree build_x_binary_op (enum tree_code, tree, tree,
+extern tree build_x_binary_op (enum tree_code, tree, tree,
bool *);
extern tree build_x_unary_op (enum tree_code, tree);
extern tree unary_complex_lvalue (enum tree_code, tree);
static hashval_t list_hash (const void *);
static cp_lvalue_kind lvalue_p_1 (tree, int);
static tree mark_local_for_remap_r (tree *, int *, void *);
-static tree cp_unsave_r (tree *, int *, void *);
static tree build_target_expr (tree, tree);
static tree count_trees_r (tree *, int *, void *);
static tree verify_stmt_tree_r (tree *, int *, void *);
return NULL_TREE;
}
-/* Called via walk_tree when an expression is unsaved. Using the
- splay_tree pointed to by ST (which is really a `splay_tree'),
- remaps all local declarations to appropriate replacements. */
-
-static tree
-cp_unsave_r (tree* tp,
- int* walk_subtrees,
- void* data)
-{
- splay_tree st = (splay_tree) data;
- splay_tree_node n;
-
- /* Only a local declaration (variable or label). */
- if (nonstatic_local_decl_p (*tp))
- {
- /* Lookup the declaration. */
- n = splay_tree_lookup (st, (splay_tree_key) *tp);
-
- /* If it's there, remap it. */
- if (n)
- *tp = (tree) n->value;
- }
- else if (TREE_CODE (*tp) == SAVE_EXPR)
- remap_save_expr (tp, st, walk_subtrees);
- else
- {
- copy_tree_r (tp, walk_subtrees, NULL);
-
- /* Do whatever unsaving is required. */
- unsave_expr_1 (*tp);
- }
-
- /* Keep iterating. */
- return NULL_TREE;
-}
-
-/* Called whenever an expression needs to be unsaved. */
-
-tree
-cxx_unsave_expr_now (tree tp)
-{
- splay_tree st;
-
- /* Create a splay-tree to map old local variable declarations to new
- ones. */
- st = splay_tree_new (splay_tree_compare_pointers, NULL, NULL);
-
- /* Walk the tree once figuring out what needs to be remapped. */
- walk_tree (&tp, mark_local_for_remap_r, st, NULL);
-
- /* Walk the tree again, copying, remapping, and unsaving. */
- walk_tree (&tp, cp_unsave_r, st, NULL);
-
- /* Clean up. */
- splay_tree_delete (st);
-
- return tp;
-}
-
/* Returns the kind of special function that DECL (a FUNCTION_DECL)
is. Note that sfk_none is zero, so this function can be used as a
predicate to test whether or not DECL is a special function. */
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL lhd_do_nothing_t
#define LANG_HOOKS_STATICP lhd_staticp
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL lhd_do_nothing_t
-#define LANG_HOOKS_UNSAVE_EXPR_NOW lhd_unsave_expr_now
#define LANG_HOOKS_SET_DECL_ASSEMBLER_NAME lhd_set_decl_assembler_name
#define LANG_HOOKS_CAN_USE_BIT_FIELDS_P lhd_can_use_bit_fields_p
#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS false
LANG_HOOKS_MARK_ADDRESSABLE, \
LANG_HOOKS_STATICP, \
LANG_HOOKS_DUP_LANG_SPECIFIC_DECL, \
- LANG_HOOKS_UNSAVE_EXPR_NOW, \
LANG_HOOKS_SET_DECL_ASSEMBLER_NAME, \
LANG_HOOKS_CAN_USE_BIT_FIELDS_P, \
LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS, \
DECL_NODE with a newly GC-allocated copy. */
void (*dup_lang_specific_decl) (tree);
- /* Reset argument so that it can be expanded again.
- Modify it in-place so that all the evaluate only once
- things are cleared out. */
- tree (*unsave_expr_now) (tree);
-
/* Set the DECL_ASSEMBLER_NAME for a node. If it is the sort of
thing that the assembler should talk about, set
DECL_ASSEMBLER_NAME to an appropriate IDENTIFIER_NODE.
we get to rtl. Once we're done with lowering here, if we lose
the information there's no way to recover it!
- (2) There are many more statements that *cannot* throw as
+ (2) There are many more statements that *cannot* throw as
compared to those that can. We should be saving some amount
of space by only allocating memory for those that can throw. */
struct leh_state
{
- /* What's "current" while constructing the eh region tree. These
+ /* What's "current" while constructing the eh region tree. These
correspond to variables of the same name in cfun->eh, which we
don't have easy access to. */
struct eh_region *cur_region;
struct leh_tf_state
{
/* Pointer to the TRY_FINALLY node under discussion. The try_finally_expr
- is the original TRY_FINALLY_EXPR. We need to retain this so that
+ is the original TRY_FINALLY_EXPR. We need to retain this so that
outside_finally_tree can reliably reference the tree used in the
collect_finally_tree data structures. */
tree try_finally_expr;
though subsequent transformations may have cleared that flag. */
tree fallthru_label;
- /* A label that has been registered with except.c to be the
+ /* A label that has been registered with except.c to be the
landing pad for this try block. */
tree eh_label;
static void lower_eh_filter (struct leh_state *, tree *);
static void lower_eh_constructs_1 (struct leh_state *, tree *);
-/* Comparison function for qsort/bsearch. We're interested in
+/* Comparison function for qsort/bsearch. We're interested in
searching goto queue elements for source statements. */
static int
tsi_link_after (tsi, new, TSI_CONTINUE_LINKING);
}
-/* The real work of replace_goto_queue. Returns with TSI updated to
+/* The real work of replace_goto_queue. Returns with TSI updated to
point to the next statement. */
static void replace_goto_queue_stmt_list (tree, struct leh_tf_state *);
{
tree lab = GOTO_DESTINATION (stmt);
- /* Computed and non-local gotos do not get processed. Given
+ /* Computed and non-local gotos do not get processed. Given
their nature we can neither tell whether we've escaped the
finally block nor redirect them if we knew. */
if (TREE_CODE (lab) != LABEL_DECL)
/* No need to record gotos that don't leave the try block. */
if (! outside_finally_tree (lab, tf->try_finally_expr))
return;
-
+
if (! tf->dest_array)
{
VARRAY_TREE_INIT (tf->dest_array, 10, "dest_array");
q = &tf->goto_queue[active];
tf->goto_queue_active = active + 1;
-
+
memset (q, 0, sizeof (*q));
q->stmt = stmt;
q->index = index;
{
tree region = NULL;
- t = lhd_unsave_expr_now (t);
+ t = unsave_expr_now (t);
if (outer_state->tf)
region = outer_state->tf->try_finally_expr;
label = create_artificial_label ();
tf->fallthru_label = label;
if (tf->outer->tf)
- record_in_finally_tree (label, tf->outer->tf->try_finally_expr);
+ record_in_finally_tree (label, tf->outer->tf->try_finally_expr);
}
return label;
}
where "fintmp" is the temporary used in the switch statement generation
alternative considered below. For the nonce, we always choose the first
- option.
+ option.
THIS_STATE may be null if if this is a try-cleanup, not a try-finally. */
append_to_statement_list (x, tf->top_p);
append_to_statement_list (finally, tf->top_p);
-
+
x = build1 (RESX_EXPR, void_type_node,
build_int_cst (NULL_TREE,
get_eh_region_number (tf->region), 0));
for (; q < qe; ++q)
do_goto_redirection (q, finally_label, NULL);
replace_goto_queue (tf);
-
+
if (VARRAY_TREE (tf->dest_array, 0) == tf->fallthru_label)
{
/* Reachable by goto to fallthru label only. Redirect it
/* A subroutine of lower_eh_constructs_1. Lower a TRY_FINALLY_EXPR nodes
to a sequence of labels and blocks, plus the exception region trees
- that record all the magic. This is complicated by the need to
+ that record all the magic. This is complicated by the need to
arrange for the FINALLY block to be executed on all exits. */
static void
}
/* A subroutine of lower_eh_constructs_1. Lower a TRY_CATCH_EXPR with a
- list of CATCH_EXPR nodes to a sequence of labels and blocks, plus the
+ list of CATCH_EXPR nodes to a sequence of labels and blocks, plus the
exception region trees that record all the magic. */
static void
struct eh_region *this_region;
tree inner = expr_first (TREE_OPERAND (*tp, 1));
tree eh_label;
-
+
if (EH_FILTER_MUST_NOT_THROW (inner))
this_region = gen_eh_region_must_not_throw (state->cur_region);
else
EH_FILTER_TYPES (inner));
this_state = *state;
this_state.cur_region = this_region;
-
+
lower_eh_constructs_1 (&this_state, &TREE_OPERAND (*tp, 0));
if (!get_eh_region_may_contain_throw (this_region))
record_stmt_eh_region (state->cur_region, t);
note_eh_region_may_contain_throw (state->cur_region);
- /* ??? For the benefit of calls.c, converting all this to rtl,
+ /* ??? For the benefit of calls.c, converting all this to rtl,
we need to record the call expression, not just the outer
modify statement. */
op = get_call_expr_in (t);
collect_eh_region_array ();
}
-struct tree_opt_pass pass_lower_eh =
+struct tree_opt_pass pass_lower_eh =
{
"eh", /* name */
NULL, /* gate */
make_edge (src, dst, EDGE_ABNORMAL | EDGE_EH);
}
-
+
void
make_eh_edges (tree stmt)
{
static tree remap_decls (tree, inline_data *);
static void copy_bind_expr (tree *, int *, inline_data *);
static tree mark_local_for_remap_r (tree *, int *, void *);
+static void unsave_expr_1 (tree);
static tree unsave_r (tree *, int *, void *);
static void declare_inline_vars (tree bind_expr, tree vars);
return NULL_TREE;
}
+/* Perform any modifications to EXPR required when it is unsaved. Does
+ not recurse into EXPR's subtrees. */
+
+static void
+unsave_expr_1 (tree expr)
+{
+ switch (TREE_CODE (expr))
+ {
+ case TARGET_EXPR:
+ /* Don't mess with a TARGET_EXPR that hasn't been expanded.
+ It's OK for this to happen if it was part of a subtree that
+ isn't immediately expanded, such as operand 2 of another
+ TARGET_EXPR. */
+ if (TREE_OPERAND (expr, 1))
+ break;
+
+ TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 3);
+ TREE_OPERAND (expr, 3) = NULL_TREE;
+ break;
+
+ default:
+ break;
+ }
+}
+
/* Called via walk_tree when an expression is unsaved. Using the
splay_tree pointed to by ST (which is really a `splay_tree'),
remaps all local declarations to appropriate replacements. */
return NULL_TREE;
}
-/* Default lang hook for "unsave_expr_now". Copies everything in EXPR and
- replaces variables, labels and SAVE_EXPRs local to EXPR. */
+/* Copies everything in EXPR and replaces variables, labels
+ and SAVE_EXPRs local to EXPR. */
tree
-lhd_unsave_expr_now (tree expr)
+unsave_expr_now (tree expr)
{
inline_data id;
Contributed by Diego Novillo <dnovillo@redhat.com>
This file is part of GCC.
-
+
GCC is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
-
+
GCC is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
-
+
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* This object of this pass is to replace a non-addressable aggregate with a
set of independent variables. Most of the time, all of these variables
- will be scalars. But a secondary objective is to break up larger
+ will be scalars. But a secondary objective is to break up larger
aggregates into smaller aggregates. In the process we may find that some
bits of the larger aggregate can be deleted as unreferenced.
return h;
}
-
+
/* Equality function for type SRA_PAIR. */
static int
return true;
}
-/* Create or return the SRA_ELT structure for EXPR if the expression
+/* Create or return the SRA_ELT structure for EXPR if the expression
refers to a scalarizable variable. */
static struct sra_elt *
index reference inside a loop being overridden by several constant
index references during loop setup. It's possible that this could
be avoided by using dynamic usage counts based on BB trip counts
- (based on loop analysis or profiling), but that hardly seems worth
+ (based on loop analysis or profiling), but that hardly seems worth
the effort. */
/* ??? Hack. Figure out how to push this into the scan routines
without duplicating too much code. */
case BIT_FIELD_REF:
/* A bit field reference (access to *multiple* fields simultaneously)
- is not currently scalarized. Consider this an access to the
+ is not currently scalarized. Consider this an access to the
complete outer element, to which walk_tree will bring us next. */
goto use_all;
the function multiple times, and other evil things. */
else if (!lhs_elt->is_scalar && is_gimple_addressable (rhs))
fns->ldst (lhs_elt, rhs, bsi, true);
-
+
/* Otherwise we're being used in some context that requires the
aggregate to be seen as a whole. Invoke USE. */
else
any_set = true;
}
}
-
+
return any_set;
}
full_size = tree_low_cst (size_tree, 1);
- /* ??? What to do here. If there are two fields, and we've only
+ /* ??? What to do here. If there are two fields, and we've only
instantiated one, then instantiating the other is clearly a win.
If there are a large number of fields then the size of the copy
is much more of a factor. */
if (cleared_any)
{
- bitmap_operation (sra_candidates, sra_candidates, &done_head,
+ bitmap_operation (sra_candidates, sra_candidates, &done_head,
BITMAP_AND_COMPL);
- bitmap_operation (needs_copy_in, needs_copy_in, &done_head,
+ bitmap_operation (needs_copy_in, needs_copy_in, &done_head,
BITMAP_AND_COMPL);
}
bitmap_clear (&done_head);
first_copy = false;
}
else
- bsi_insert_on_edge (e, lhd_unsave_expr_now (stmt));
+ bsi_insert_on_edge (e, unsave_expr_now (stmt));
}
}
}
else if (lhs_elt->use_block_copy || rhs_elt->use_block_copy)
{
/* If either side requires a block copy, then sync the RHS back
- to the original structure, leave the original assignment
+ to the original structure, leave the original assignment
statement (which will perform the block copy), then load the
LHS values out of its now-updated original structure. */
/* ??? Could perform a modified pair-wise element copy. That
/* Replace the old statement with this new representative. */
bsi_replace (bsi, first, true);
-
+
if (!tsi_end_p (tsi))
{
/* If any reference would trap, then they all would. And more
size_t i;
EXECUTE_IF_SET_IN_BITMAP (needs_copy_in, 0, i,
- {
+ {
tree var = referenced_var (i);
struct sra_elt *elt = lookup_element (NULL, var, NULL, NO_INSERT);
generate_copy_inout (elt, true, var, &list);
return flag_tree_sra != 0;
}
-struct tree_opt_pass pass_sra =
+struct tree_opt_pass pass_sra =
{
"sra", /* name */
gate_sra, /* gate */
/* FIXME. GIMPLE is allowing pointer assignments and comparisons of
pointers that have different alias sets. This means that these
pointers will have different memory tags associated to them.
-
+
If we allow copy propagation in these cases, statements de-referencing
the new pointer will now have a reference to a different memory tag
with potentially incorrect SSA information.
/* Given two SSA_NAMEs pointers ORIG and NEW such that we are copy
propagating NEW into ORIG, consolidate aliasing information so that
they both share the same memory tags. */
-
+
static void
merge_alias_info (tree orig, tree new)
{
orig_ann->type_mem_tag = new_ann->type_mem_tag;
else if (new_ann->type_mem_tag != orig_ann->type_mem_tag)
abort ();
-}
+}
/* Common code for propagate_value and replace_exp.
- Replace use operand OP_P with VAL. FOR_PROPAGATION indicates if the
+ Replace use operand OP_P with VAL. FOR_PROPAGATION indicates if the
replacement is done to propagate a value or not. */
static void
SET_USE (op_p, val);
}
else
- SET_USE (op_p, lhd_unsave_expr_now (val));
+ SET_USE (op_p, unsave_expr_now (val));
}
/* Propagate the value VAL (assumed to be a constant or another SSA_NAME)
into the tree pointed by OP_P.
- Use this version for const/copy propagation when SSA operands are not
- available. It will perform the additional checks to ensure validity of
+ Use this version for const/copy propagation when SSA operands are not
+ available. It will perform the additional checks to ensure validity of
the const/copy propagation, but will not update any operand information.
Be sure to mark the stmt as modified. */
*op_p = val;
}
else
- *op_p = lhd_unsave_expr_now (val);
+ *op_p = unsave_expr_now (val);
}
if (!type)
type = integer_type_node;
-
+
switch (TREE_CODE (type))
{
case POINTER_TYPE:
ix = 0;
}
break;
-
+
case BOOLEAN_TYPE:
/* Cache false or true. */
limit = 2;
if (!hi && low < 2)
ix = low;
break;
-
+
case INTEGER_TYPE:
case CHAR_TYPE:
case OFFSET_TYPE:
default:
break;
}
-
+
if (ix >= 0)
{
if (!TYPE_CACHED_VALUES_P (type))
TYPE_CACHED_VALUES_P (type) = 1;
TYPE_CACHED_VALUES (type) = make_tree_vec (limit);
}
-
+
t = TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix);
if (t)
{
return t;
}
}
-
+
t = make_node (INTEGER_CST);
TREE_INT_CST_LOW (t) = low;
if (ix >= 0)
TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix) = t;
-
+
return t;
}
abort ();
}
}
-
-/* Perform any modifications to EXPR required when it is unsaved. Does
- not recurse into EXPR's subtrees. */
-
-void
-unsave_expr_1 (tree expr)
-{
- switch (TREE_CODE (expr))
- {
- case TARGET_EXPR:
- /* Don't mess with a TARGET_EXPR that hasn't been expanded.
- It's OK for this to happen if it was part of a subtree that
- isn't immediately expanded, such as operand 2 of another
- TARGET_EXPR. */
- if (TREE_OPERAND (expr, 1))
- break;
-
- TREE_OPERAND (expr, 1) = TREE_OPERAND (expr, 3);
- TREE_OPERAND (expr, 3) = NULL_TREE;
- break;
-
- default:
- break;
- }
-}
\f
/* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
or offset that depends on a field within a record. */
enum tree_node_structure_enum tree_node_structure (tree);
-/* Reset EXP in place so that it can be expanded again. Does not
- recurse into subtrees. */
-
-extern void unsave_expr_1 (tree);
-
/* Return 1 if EXP contains a PLACEHOLDER_EXPR; i.e., if it represents a size
or offset that depends on a field within a record.
extern tree get_callee_fndecl (tree);
extern void change_decl_assembler_name (tree, tree);
extern int type_num_arguments (tree);
-extern tree lhd_unsave_expr_now (tree);
extern bool associative_tree_code (enum tree_code);
extern bool commutative_tree_code (enum tree_code);
/* In tree-inline.c: */
extern bool debug_find_tree (tree, tree);
+/* This is in tree-inline.c since the routine uses
+ data structures from the inliner. */
+extern tree unsave_expr_now (tree);
/* In expr.c */
extern rtx expand_builtin_return_addr (enum built_in_function, int, rtx);