Commit f65f1ae3 by Martin Jambor Committed by Martin Jambor

[PR 79108] Put ipa_node_params to GC memory

2017-01-23  Martin Jambor  <mjambor@suse.cz>

	PR ipa/79108
	* ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()).
	(ipa_node_params): Annotate with GTY((for_user)).  Make descriptors
	field a pointer to garbage collected vector, mark lattices and
	ipcp_orig_node with GTY((skip)).
	(ipa_get_param_count): Adjust to descriptors being a pointer.
	(ipa_get_param): Likewise.
	(ipa_get_type): Likewise.
	(ipa_get_param_move_cost): Likewise.
	(ipa_set_param_used): Likewise.
	(ipa_get_controlled_uses): Likewise.
	(ipa_set_controlled_uses): Likewise.
	(ipa_is_param_used): Likewise.
	(ipa_node_params_t): Move into garbage collector.  New methods insert
	and remove.
	(ipa_node_params_sum): Annotate wth GTY(()).
	(ipa_check_create_node_params): Adjust to ipa_node_params_sum being
	garbage collected.
	(ipa_load_from_parm_agg): Adjust declaration.
	* ipa-icf.c (param_used_p): Adjust to descriptors being a pointer.
	* ipa-profile.c (ipa_profile): Likewise.
	* ipa-prop.c (ipa_get_param_decl_index_1): Likewise.
	(ipa_populate_param_decls): Make descriptors parameter garbage
	collected.
	(ipa_dump_param): Adjust to descriptors being a pointer.
	(ipa_alloc_node_params): Likewise.
	(ipa_initialize_node_params): Likewise.
	(load_from_param_1): Make descriptors parameter garbage collected.
	(load_from_unmodified_param): Likewise.
	(load_from_param): Likewise.
	(ipa_load_from_parm_agg): Likewise.
	(ipa_node_params::~ipa_node_params): Removed.
	(ipa_free_all_node_params): Remove call to delete operator.
	(ipa_node_params_t::insert): New.
	(ipa_node_params_t::remove): Likewise.
	(ipa_node_params_t::duplicate): Adjust to descriptors being a pointer,
	copy known_csts and known_contexts vectors.
	(ipa_read_node_info): Adjust to descriptors being a pointer.
	(ipcp_modif_dom_walker): Make m_descriptors field garbage
	collected.
	(ipcp_transform_function): Make descriptors variable garbage
	collected.

testsuite/
	* gfortran.dg/lto/pr79108_0.f90: New test.

From-SVN: r244802
parent dea06111
2017-01-23 Martin Jambor <mjambor@suse.cz>
PR ipa/79108
* ipa-prop.h (ipa_param_descriptor): Anotate with with GTY(()).
(ipa_node_params): Annotate with GTY((for_user)). Make descriptors
field a pointer to garbage collected vector, mark lattices and
ipcp_orig_node with GTY((skip)).
(ipa_get_param_count): Adjust to descriptors being a pointer.
(ipa_get_param): Likewise.
(ipa_get_type): Likewise.
(ipa_get_param_move_cost): Likewise.
(ipa_set_param_used): Likewise.
(ipa_get_controlled_uses): Likewise.
(ipa_set_controlled_uses): Likewise.
(ipa_is_param_used): Likewise.
(ipa_node_params_t): Move into garbage collector. New methods insert
and remove.
(ipa_node_params_sum): Annotate wth GTY(()).
(ipa_check_create_node_params): Adjust to ipa_node_params_sum being
garbage collected.
(ipa_load_from_parm_agg): Adjust declaration.
* ipa-icf.c (param_used_p): Adjust to descriptors being a pointer.
* ipa-profile.c (ipa_profile): Likewise.
* ipa-prop.c (ipa_get_param_decl_index_1): Likewise.
(ipa_populate_param_decls): Make descriptors parameter garbage
collected.
(ipa_dump_param): Adjust to descriptors being a pointer.
(ipa_alloc_node_params): Likewise.
(ipa_initialize_node_params): Likewise.
(load_from_param_1): Make descriptors parameter garbage collected.
(load_from_unmodified_param): Likewise.
(load_from_param): Likewise.
(ipa_load_from_parm_agg): Likewise.
(ipa_node_params::~ipa_node_params): Removed.
(ipa_free_all_node_params): Remove call to delete operator.
(ipa_node_params_t::insert): New.
(ipa_node_params_t::remove): Likewise.
(ipa_node_params_t::duplicate): Adjust to descriptors being a pointer,
copy known_csts and known_contexts vectors.
(ipa_read_node_info): Adjust to descriptors being a pointer.
(ipcp_modif_dom_walker): Make m_descriptors field garbage
collected.
(ipcp_transform_function): Make descriptors variable garbage
collected.
2017-01-23 Andrew Senkevich <andrew.senkevich@intel.com> 2017-01-23 Andrew Senkevich <andrew.senkevich@intel.com>
* config/i386/avx512bwintrin.h: Add k-mask test, kortest intrinsics. * config/i386/avx512bwintrin.h: Add k-mask test, kortest intrinsics.
......
...@@ -539,8 +539,7 @@ sem_function::param_used_p (unsigned int i) ...@@ -539,8 +539,7 @@ sem_function::param_used_p (unsigned int i)
struct ipa_node_params *parms_info = IPA_NODE_REF (get_node ()); struct ipa_node_params *parms_info = IPA_NODE_REF (get_node ());
if (parms_info->descriptors.is_empty () if (vec_safe_length (parms_info->descriptors) <= i)
|| parms_info->descriptors.length () <= i)
return true; return true;
return ipa_is_param_used (IPA_NODE_REF (get_node ()), i); return ipa_is_param_used (IPA_NODE_REF (get_node ()), i);
......
...@@ -621,7 +621,8 @@ ipa_profile (void) ...@@ -621,7 +621,8 @@ ipa_profile (void)
"and can be discarded.\n"); "and can be discarded.\n");
} }
else if (ipa_node_params_sum && ipa_edge_args_vector else if (ipa_node_params_sum && ipa_edge_args_vector
&& !IPA_NODE_REF (n2)->descriptors.is_empty () && (!vec_safe_is_empty
(IPA_NODE_REF (n2)->descriptors))
&& ipa_get_param_count (IPA_NODE_REF (n2)) && ipa_get_param_count (IPA_NODE_REF (n2))
!= ipa_get_cs_argument_count (IPA_EDGE_REF (e)) != ipa_get_cs_argument_count (IPA_EDGE_REF (e))
&& (ipa_get_param_count (IPA_NODE_REF (n2)) && (ipa_get_param_count (IPA_NODE_REF (n2))
......
...@@ -99,13 +99,14 @@ ipa_func_spec_opts_forbid_analysis_p (struct cgraph_node *node) ...@@ -99,13 +99,14 @@ ipa_func_spec_opts_forbid_analysis_p (struct cgraph_node *node)
to INFO. */ to INFO. */
static int static int
ipa_get_param_decl_index_1 (vec<ipa_param_descriptor> descriptors, tree ptree) ipa_get_param_decl_index_1 (vec<ipa_param_descriptor, va_gc> *descriptors,
tree ptree)
{ {
int i, count; int i, count;
count = descriptors.length (); count = vec_safe_length (descriptors);
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
if (descriptors[i].decl_or_type == ptree) if ((*descriptors)[i].decl_or_type == ptree)
return i; return i;
return -1; return -1;
...@@ -125,7 +126,7 @@ ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree) ...@@ -125,7 +126,7 @@ ipa_get_param_decl_index (struct ipa_node_params *info, tree ptree)
static void static void
ipa_populate_param_decls (struct cgraph_node *node, ipa_populate_param_decls (struct cgraph_node *node,
vec<ipa_param_descriptor> &descriptors) vec<ipa_param_descriptor, va_gc> &descriptors)
{ {
tree fndecl; tree fndecl;
tree fnargs; tree fnargs;
...@@ -168,10 +169,10 @@ void ...@@ -168,10 +169,10 @@ void
ipa_dump_param (FILE *file, struct ipa_node_params *info, int i) ipa_dump_param (FILE *file, struct ipa_node_params *info, int i)
{ {
fprintf (file, "param #%i", i); fprintf (file, "param #%i", i);
if (info->descriptors[i].decl_or_type) if ((*info->descriptors)[i].decl_or_type)
{ {
fprintf (file, " "); fprintf (file, " ");
print_generic_expr (file, info->descriptors[i].decl_or_type, 0); print_generic_expr (file, (*info->descriptors)[i].decl_or_type, 0);
} }
} }
...@@ -183,8 +184,8 @@ ipa_alloc_node_params (struct cgraph_node *node, int param_count) ...@@ -183,8 +184,8 @@ ipa_alloc_node_params (struct cgraph_node *node, int param_count)
{ {
struct ipa_node_params *info = IPA_NODE_REF (node); struct ipa_node_params *info = IPA_NODE_REF (node);
if (!info->descriptors.exists () && param_count) if (!info->descriptors && param_count)
info->descriptors.safe_grow_cleared (param_count); vec_safe_grow_cleared (info->descriptors, param_count);
} }
/* Initialize the ipa_node_params structure associated with NODE by counting /* Initialize the ipa_node_params structure associated with NODE by counting
...@@ -196,10 +197,10 @@ ipa_initialize_node_params (struct cgraph_node *node) ...@@ -196,10 +197,10 @@ ipa_initialize_node_params (struct cgraph_node *node)
{ {
struct ipa_node_params *info = IPA_NODE_REF (node); struct ipa_node_params *info = IPA_NODE_REF (node);
if (!info->descriptors.exists ()) if (!info->descriptors)
{ {
ipa_alloc_node_params (node, count_formal_params (node->decl)); ipa_alloc_node_params (node, count_formal_params (node->decl));
ipa_populate_param_decls (node, info->descriptors); ipa_populate_param_decls (node, *info->descriptors);
} }
} }
...@@ -867,7 +868,7 @@ parm_preserved_before_stmt_p (struct ipa_func_body_info *fbi, int index, ...@@ -867,7 +868,7 @@ parm_preserved_before_stmt_p (struct ipa_func_body_info *fbi, int index,
static int static int
load_from_param_1 (struct ipa_func_body_info *fbi, load_from_param_1 (struct ipa_func_body_info *fbi,
vec<ipa_param_descriptor> descriptors, vec<ipa_param_descriptor, va_gc> *descriptors,
gimple *stmt) gimple *stmt)
{ {
int index; int index;
...@@ -892,7 +893,7 @@ load_from_param_1 (struct ipa_func_body_info *fbi, ...@@ -892,7 +893,7 @@ load_from_param_1 (struct ipa_func_body_info *fbi,
static int static int
load_from_unmodified_param (struct ipa_func_body_info *fbi, load_from_unmodified_param (struct ipa_func_body_info *fbi,
vec<ipa_param_descriptor> descriptors, vec<ipa_param_descriptor, va_gc> *descriptors,
gimple *stmt) gimple *stmt)
{ {
if (!gimple_assign_single_p (stmt)) if (!gimple_assign_single_p (stmt))
...@@ -906,7 +907,7 @@ load_from_unmodified_param (struct ipa_func_body_info *fbi, ...@@ -906,7 +907,7 @@ load_from_unmodified_param (struct ipa_func_body_info *fbi,
static int static int
load_from_param (struct ipa_func_body_info *fbi, load_from_param (struct ipa_func_body_info *fbi,
vec<ipa_param_descriptor> descriptors, vec<ipa_param_descriptor, va_gc> *descriptors,
gimple *stmt) gimple *stmt)
{ {
if (!is_gimple_assign (stmt)) if (!is_gimple_assign (stmt))
...@@ -1010,7 +1011,7 @@ parm_ref_data_pass_through_p (struct ipa_func_body_info *fbi, int index, ...@@ -1010,7 +1011,7 @@ parm_ref_data_pass_through_p (struct ipa_func_body_info *fbi, int index,
bool bool
ipa_load_from_parm_agg (struct ipa_func_body_info *fbi, ipa_load_from_parm_agg (struct ipa_func_body_info *fbi,
vec<ipa_param_descriptor> descriptors, vec<ipa_param_descriptor, va_gc> *descriptors,
gimple *stmt, tree op, int *index_p, gimple *stmt, tree op, int *index_p,
HOST_WIDE_INT *offset_p, HOST_WIDE_INT *size_p, HOST_WIDE_INT *offset_p, HOST_WIDE_INT *size_p,
bool *by_ref_p, bool *guaranteed_unmodified) bool *by_ref_p, bool *guaranteed_unmodified)
...@@ -3604,33 +3605,11 @@ ipa_free_all_edge_args (void) ...@@ -3604,33 +3605,11 @@ ipa_free_all_edge_args (void)
vec_free (ipa_edge_args_vector); vec_free (ipa_edge_args_vector);
} }
/* Frees all dynamically allocated structures that the param info points
to. */
ipa_node_params::~ipa_node_params ()
{
descriptors.release ();
free (lattices);
/* Lattice values and their sources are deallocated with their alocation
pool. */
known_csts.release ();
known_contexts.release ();
lattices = NULL;
ipcp_orig_node = NULL;
analysis_done = 0;
node_enqueued = 0;
do_clone_for_all_contexts = 0;
is_all_contexts_clone = 0;
node_dead = 0;
}
/* Free all ipa_node_params structures. */ /* Free all ipa_node_params structures. */
void void
ipa_free_all_node_params (void) ipa_free_all_node_params (void)
{ {
delete ipa_node_params_sum;
ipa_node_params_sum = NULL; ipa_node_params_sum = NULL;
} }
...@@ -3792,6 +3771,36 @@ ipa_add_new_function (cgraph_node *node, void *data ATTRIBUTE_UNUSED) ...@@ -3792,6 +3771,36 @@ ipa_add_new_function (cgraph_node *node, void *data ATTRIBUTE_UNUSED)
ipa_analyze_node (node); ipa_analyze_node (node);
} }
/* Initialize a newly created param info. */
void
ipa_node_params_t::insert (cgraph_node *, ipa_node_params *info)
{
info->lattices = NULL;
info->ipcp_orig_node = NULL;
info->analysis_done = 0;
info->node_enqueued = 0;
info->do_clone_for_all_contexts = 0;
info->is_all_contexts_clone = 0;
info->node_dead = 0;
info->node_within_scc = 0;
info->node_calling_single_call = 0;
info->versionable = 0;
}
/* Frees all dynamically allocated structures that the param info points
to. */
void
ipa_node_params_t::remove (cgraph_node *, ipa_node_params *info)
{
free (info->lattices);
/* Lattice values and their sources are deallocated with their alocation
pool. */
info->known_csts.release ();
info->known_contexts.release ();
}
/* Hook that is called by summary when a node is duplicated. */ /* Hook that is called by summary when a node is duplicated. */
void void
...@@ -3801,9 +3810,11 @@ ipa_node_params_t::duplicate(cgraph_node *src, cgraph_node *dst, ...@@ -3801,9 +3810,11 @@ ipa_node_params_t::duplicate(cgraph_node *src, cgraph_node *dst,
{ {
ipa_agg_replacement_value *old_av, *new_av; ipa_agg_replacement_value *old_av, *new_av;
new_info->descriptors = old_info->descriptors.copy (); new_info->descriptors = vec_safe_copy (old_info->descriptors);
new_info->lattices = NULL; new_info->lattices = NULL;
new_info->ipcp_orig_node = old_info->ipcp_orig_node; new_info->ipcp_orig_node = old_info->ipcp_orig_node;
new_info->known_csts = old_info->known_csts.copy ();
new_info->known_contexts = old_info->known_contexts.copy ();
new_info->analysis_done = old_info->analysis_done; new_info->analysis_done = old_info->analysis_done;
new_info->node_enqueued = old_info->node_enqueued; new_info->node_enqueued = old_info->node_enqueued;
...@@ -5022,7 +5033,7 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node, ...@@ -5022,7 +5033,7 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
ipa_alloc_node_params (node, streamer_read_uhwi (ib)); ipa_alloc_node_params (node, streamer_read_uhwi (ib));
for (k = 0; k < ipa_get_param_count (info); k++) for (k = 0; k < ipa_get_param_count (info); k++)
info->descriptors[k].move_cost = streamer_read_uhwi (ib); (*info->descriptors)[k].move_cost = streamer_read_uhwi (ib);
bp = streamer_read_bitpack (ib); bp = streamer_read_bitpack (ib);
if (ipa_get_param_count (info) != 0) if (ipa_get_param_count (info) != 0)
...@@ -5033,7 +5044,7 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node, ...@@ -5033,7 +5044,7 @@ ipa_read_node_info (struct lto_input_block *ib, struct cgraph_node *node,
for (k = 0; k < ipa_get_param_count (info); k++) for (k = 0; k < ipa_get_param_count (info); k++)
{ {
ipa_set_controlled_uses (info, k, streamer_read_hwi (ib)); ipa_set_controlled_uses (info, k, streamer_read_hwi (ib));
info->descriptors[k].decl_or_type = stream_read_tree (ib, data_in); (*info->descriptors)[k].decl_or_type = stream_read_tree (ib, data_in);
} }
for (e = node->callees; e; e = e->next_callee) for (e = node->callees; e; e = e->next_callee)
{ {
...@@ -5483,7 +5494,7 @@ class ipcp_modif_dom_walker : public dom_walker ...@@ -5483,7 +5494,7 @@ class ipcp_modif_dom_walker : public dom_walker
{ {
public: public:
ipcp_modif_dom_walker (struct ipa_func_body_info *fbi, ipcp_modif_dom_walker (struct ipa_func_body_info *fbi,
vec<ipa_param_descriptor> descs, vec<ipa_param_descriptor, va_gc> *descs,
struct ipa_agg_replacement_value *av, struct ipa_agg_replacement_value *av,
bool *sc, bool *cc) bool *sc, bool *cc)
: dom_walker (CDI_DOMINATORS), m_fbi (fbi), m_descriptors (descs), : dom_walker (CDI_DOMINATORS), m_fbi (fbi), m_descriptors (descs),
...@@ -5493,7 +5504,7 @@ public: ...@@ -5493,7 +5504,7 @@ public:
private: private:
struct ipa_func_body_info *m_fbi; struct ipa_func_body_info *m_fbi;
vec<ipa_param_descriptor> m_descriptors; vec<ipa_param_descriptor, va_gc> *m_descriptors;
struct ipa_agg_replacement_value *m_aggval; struct ipa_agg_replacement_value *m_aggval;
bool *m_something_changed, *m_cfg_changed; bool *m_something_changed, *m_cfg_changed;
}; };
...@@ -5751,7 +5762,7 @@ ipcp_update_vr (struct cgraph_node *node) ...@@ -5751,7 +5762,7 @@ ipcp_update_vr (struct cgraph_node *node)
unsigned int unsigned int
ipcp_transform_function (struct cgraph_node *node) ipcp_transform_function (struct cgraph_node *node)
{ {
vec<ipa_param_descriptor> descriptors = vNULL; vec<ipa_param_descriptor, va_gc> *descriptors = NULL;
struct ipa_func_body_info fbi; struct ipa_func_body_info fbi;
struct ipa_agg_replacement_value *aggval; struct ipa_agg_replacement_value *aggval;
int param_count; int param_count;
...@@ -5783,8 +5794,8 @@ ipcp_transform_function (struct cgraph_node *node) ...@@ -5783,8 +5794,8 @@ ipcp_transform_function (struct cgraph_node *node)
fbi.param_count = param_count; fbi.param_count = param_count;
fbi.aa_walked = 0; fbi.aa_walked = 0;
descriptors.safe_grow_cleared (param_count); vec_safe_grow_cleared (descriptors, param_count);
ipa_populate_param_decls (node, descriptors); ipa_populate_param_decls (node, *descriptors);
calculate_dominance_info (CDI_DOMINATORS); calculate_dominance_info (CDI_DOMINATORS);
ipcp_modif_dom_walker (&fbi, descriptors, aggval, &something_changed, ipcp_modif_dom_walker (&fbi, descriptors, aggval, &something_changed,
&cfg_changed).walk (ENTRY_BLOCK_PTR_FOR_FN (cfun)); &cfg_changed).walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
...@@ -5799,7 +5810,7 @@ ipcp_transform_function (struct cgraph_node *node) ...@@ -5799,7 +5810,7 @@ ipcp_transform_function (struct cgraph_node *node)
(*ipcp_transformations)[node->uid].bits = NULL; (*ipcp_transformations)[node->uid].bits = NULL;
(*ipcp_transformations)[node->uid].m_vr = NULL; (*ipcp_transformations)[node->uid].m_vr = NULL;
descriptors.release (); vec_free (descriptors);
if (!something_changed) if (!something_changed)
return 0; return 0;
......
...@@ -298,7 +298,7 @@ ipa_get_jf_ancestor_type_preserved (struct ipa_jump_func *jfunc) ...@@ -298,7 +298,7 @@ ipa_get_jf_ancestor_type_preserved (struct ipa_jump_func *jfunc)
/* Summary describing a single formal parameter. */ /* Summary describing a single formal parameter. */
struct ipa_param_descriptor struct GTY(()) ipa_param_descriptor
{ {
/* In analysis and modification phase, this is the PARAM_DECL of this /* In analysis and modification phase, this is the PARAM_DECL of this
parameter, in IPA LTO phase, this is the type of the the described parameter, in IPA LTO phase, this is the type of the the described
...@@ -318,25 +318,23 @@ struct ipa_param_descriptor ...@@ -318,25 +318,23 @@ struct ipa_param_descriptor
and some other information for interprocedural passes that operate on and some other information for interprocedural passes that operate on
parameters (such as ipa-cp). */ parameters (such as ipa-cp). */
struct ipa_node_params struct GTY((for_user)) ipa_node_params
{ {
~ipa_node_params ();
/* Information about individual formal parameters that are gathered when /* Information about individual formal parameters that are gathered when
summaries are generated. */ summaries are generated. */
vec<ipa_param_descriptor> descriptors; vec<ipa_param_descriptor, va_gc> *descriptors;
/* Pointer to an array of structures describing individual formal /* Pointer to an array of structures describing individual formal
parameters. */ parameters. */
struct ipcp_param_lattices *lattices; struct ipcp_param_lattices * GTY((skip)) lattices;
/* Only for versioned nodes this field would not be NULL, /* Only for versioned nodes this field would not be NULL,
it points to the node that IPA cp cloned from. */ it points to the node that IPA cp cloned from. */
struct cgraph_node *ipcp_orig_node; struct cgraph_node * GTY((skip)) ipcp_orig_node;
/* If this node is an ipa-cp clone, these are the known constants that /* If this node is an ipa-cp clone, these are the known constants that
describe what it has been specialized for. */ describe what it has been specialized for. */
vec<tree> known_csts; vec<tree> GTY((skip)) known_csts;
/* If this node is an ipa-cp clone, these are the known polymorphic contexts /* If this node is an ipa-cp clone, these are the known polymorphic contexts
that describe what it has been specialized for. */ that describe what it has been specialized for. */
vec<ipa_polymorphic_call_context> known_contexts; vec<ipa_polymorphic_call_context> GTY((skip)) known_contexts;
/* Whether the param uses analysis and jump function computation has already /* Whether the param uses analysis and jump function computation has already
been performed. */ been performed. */
unsigned analysis_done : 1; unsigned analysis_done : 1;
...@@ -417,7 +415,7 @@ struct ipa_func_body_info ...@@ -417,7 +415,7 @@ struct ipa_func_body_info
static inline int static inline int
ipa_get_param_count (struct ipa_node_params *info) ipa_get_param_count (struct ipa_node_params *info)
{ {
return info->descriptors.length (); return vec_safe_length (info->descriptors);
} }
/* Return the declaration of Ith formal parameter of the function corresponding /* Return the declaration of Ith formal parameter of the function corresponding
...@@ -428,8 +426,9 @@ ipa_get_param_count (struct ipa_node_params *info) ...@@ -428,8 +426,9 @@ ipa_get_param_count (struct ipa_node_params *info)
static inline tree static inline tree
ipa_get_param (struct ipa_node_params *info, int i) ipa_get_param (struct ipa_node_params *info, int i)
{ {
gcc_checking_assert (info->descriptors);
gcc_checking_assert (!flag_wpa); gcc_checking_assert (!flag_wpa);
tree t = info->descriptors[i].decl_or_type; tree t = (*info->descriptors)[i].decl_or_type;
gcc_checking_assert (TREE_CODE (t) == PARM_DECL); gcc_checking_assert (TREE_CODE (t) == PARM_DECL);
return t; return t;
} }
...@@ -440,7 +439,8 @@ ipa_get_param (struct ipa_node_params *info, int i) ...@@ -440,7 +439,8 @@ ipa_get_param (struct ipa_node_params *info, int i)
static inline tree static inline tree
ipa_get_type (struct ipa_node_params *info, int i) ipa_get_type (struct ipa_node_params *info, int i)
{ {
tree t = info->descriptors[i].decl_or_type; gcc_checking_assert (info->descriptors);
tree t = (*info->descriptors)[i].decl_or_type;
if (!t) if (!t)
return NULL; return NULL;
if (TYPE_P (t)) if (TYPE_P (t))
...@@ -455,7 +455,8 @@ ipa_get_type (struct ipa_node_params *info, int i) ...@@ -455,7 +455,8 @@ ipa_get_type (struct ipa_node_params *info, int i)
static inline int static inline int
ipa_get_param_move_cost (struct ipa_node_params *info, int i) ipa_get_param_move_cost (struct ipa_node_params *info, int i)
{ {
return info->descriptors[i].move_cost; gcc_checking_assert (info->descriptors);
return (*info->descriptors)[i].move_cost;
} }
/* Set the used flag corresponding to the Ith formal parameter of the function /* Set the used flag corresponding to the Ith formal parameter of the function
...@@ -464,7 +465,8 @@ ipa_get_param_move_cost (struct ipa_node_params *info, int i) ...@@ -464,7 +465,8 @@ ipa_get_param_move_cost (struct ipa_node_params *info, int i)
static inline void static inline void
ipa_set_param_used (struct ipa_node_params *info, int i, bool val) ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
{ {
info->descriptors[i].used = val; gcc_checking_assert (info->descriptors);
(*info->descriptors)[i].used = val;
} }
/* Return how many uses described by ipa-prop a parameter has or /* Return how many uses described by ipa-prop a parameter has or
...@@ -473,9 +475,9 @@ ipa_set_param_used (struct ipa_node_params *info, int i, bool val) ...@@ -473,9 +475,9 @@ ipa_set_param_used (struct ipa_node_params *info, int i, bool val)
static inline int static inline int
ipa_get_controlled_uses (struct ipa_node_params *info, int i) ipa_get_controlled_uses (struct ipa_node_params *info, int i)
{ {
/* FIXME: introducing speuclation causes out of bounds access here. */ /* FIXME: introducing speculation causes out of bounds access here. */
if (info->descriptors.length () > (unsigned)i) if (vec_safe_length (info->descriptors) > (unsigned)i)
return info->descriptors[i].controlled_uses; return (*info->descriptors)[i].controlled_uses;
return IPA_UNDESCRIBED_USE; return IPA_UNDESCRIBED_USE;
} }
...@@ -484,7 +486,8 @@ ipa_get_controlled_uses (struct ipa_node_params *info, int i) ...@@ -484,7 +486,8 @@ ipa_get_controlled_uses (struct ipa_node_params *info, int i)
static inline void static inline void
ipa_set_controlled_uses (struct ipa_node_params *info, int i, int val) ipa_set_controlled_uses (struct ipa_node_params *info, int i, int val)
{ {
info->descriptors[i].controlled_uses = val; gcc_checking_assert (info->descriptors);
(*info->descriptors)[i].controlled_uses = val;
} }
/* Return the used flag corresponding to the Ith formal parameter of the /* Return the used flag corresponding to the Ith formal parameter of the
...@@ -493,7 +496,8 @@ ipa_set_controlled_uses (struct ipa_node_params *info, int i, int val) ...@@ -493,7 +496,8 @@ ipa_set_controlled_uses (struct ipa_node_params *info, int i, int val)
static inline bool static inline bool
ipa_is_param_used (struct ipa_node_params *info, int i) ipa_is_param_used (struct ipa_node_params *info, int i)
{ {
return info->descriptors[i].used; gcc_checking_assert (info->descriptors);
return (*info->descriptors)[i].used;
} }
/* Information about replacements done in aggregates for a given node (each /* Information about replacements done in aggregates for a given node (each
...@@ -569,12 +573,16 @@ ipa_get_ith_polymorhic_call_context (struct ipa_edge_args *args, int i) ...@@ -569,12 +573,16 @@ ipa_get_ith_polymorhic_call_context (struct ipa_edge_args *args, int i)
} }
/* Function summary for ipa_node_params. */ /* Function summary for ipa_node_params. */
class ipa_node_params_t: public function_summary <ipa_node_params *> class GTY((user)) ipa_node_params_t: public function_summary <ipa_node_params *>
{ {
public: public:
ipa_node_params_t (symbol_table *table): ipa_node_params_t (symbol_table *table, bool ggc):
function_summary<ipa_node_params *> (table) { } function_summary<ipa_node_params *> (table, ggc) { }
/* Hook that is called by summary when a node is deleted. */
virtual void insert (cgraph_node *, ipa_node_params *info);
/* Hook that is called by summary when a node is deleted. */
virtual void remove (cgraph_node *, ipa_node_params *info);
/* Hook that is called by summary when a node is duplicated. */ /* Hook that is called by summary when a node is duplicated. */
virtual void duplicate (cgraph_node *node, virtual void duplicate (cgraph_node *node,
cgraph_node *node2, cgraph_node *node2,
...@@ -583,12 +591,14 @@ public: ...@@ -583,12 +591,14 @@ public:
}; };
/* Function summary where the parameter infos are actually stored. */ /* Function summary where the parameter infos are actually stored. */
extern ipa_node_params_t *ipa_node_params_sum; extern GTY(()) ipa_node_params_t * ipa_node_params_sum;
/* Vector of IPA-CP transformation data for each clone. */ /* Vector of IPA-CP transformation data for each clone. */
extern GTY(()) vec<ipcp_transformation_summary, va_gc> *ipcp_transformations; extern GTY(()) vec<ipcp_transformation_summary, va_gc> *ipcp_transformations;
/* Vector where the parameter infos are actually stored. */ /* Vector where the parameter infos are actually stored. */
extern GTY(()) vec<ipa_edge_args, va_gc> *ipa_edge_args_vector; extern GTY(()) vec<ipa_edge_args, va_gc> *ipa_edge_args_vector;
/* Return the associated parameter/argument info corresponding to the given /* Return the associated parameter/argument info corresponding to the given
node/edge. */ node/edge. */
#define IPA_NODE_REF(NODE) (ipa_node_params_sum->get (NODE)) #define IPA_NODE_REF(NODE) (ipa_node_params_sum->get (NODE))
...@@ -616,7 +626,9 @@ static inline void ...@@ -616,7 +626,9 @@ static inline void
ipa_check_create_node_params (void) ipa_check_create_node_params (void)
{ {
if (!ipa_node_params_sum) if (!ipa_node_params_sum)
ipa_node_params_sum = new ipa_node_params_t (symtab); ipa_node_params_sum
= (new (ggc_cleared_alloc <ipa_node_params_t> ())
ipa_node_params_t (symtab, true));
} }
/* This function ensures the array of edge arguments infos is big enough to /* This function ensures the array of edge arguments infos is big enough to
...@@ -680,7 +692,7 @@ tree ipa_find_agg_cst_for_param (struct ipa_agg_jump_function *agg, tree scalar, ...@@ -680,7 +692,7 @@ tree ipa_find_agg_cst_for_param (struct ipa_agg_jump_function *agg, tree scalar,
HOST_WIDE_INT offset, bool by_ref, HOST_WIDE_INT offset, bool by_ref,
bool *from_global_constant = NULL); bool *from_global_constant = NULL);
bool ipa_load_from_parm_agg (struct ipa_func_body_info *fbi, bool ipa_load_from_parm_agg (struct ipa_func_body_info *fbi,
vec<ipa_param_descriptor> descriptors, vec<ipa_param_descriptor, va_gc> *descriptors,
gimple *stmt, tree op, int *index_p, gimple *stmt, tree op, int *index_p,
HOST_WIDE_INT *offset_p, HOST_WIDE_INT *size_p, HOST_WIDE_INT *offset_p, HOST_WIDE_INT *size_p,
bool *by_ref, bool *guaranteed_unmodified = NULL); bool *by_ref, bool *guaranteed_unmodified = NULL);
......
2017-01-23 Martin Jambor <mjambor@suse.cz>
PR ipa/79108
* gfortran.dg/lto/pr79108_0.f90: New test.
2017-01-23 Andrew Senkevich <andrew.senkevich@intel.com> 2017-01-23 Andrew Senkevich <andrew.senkevich@intel.com>
* gcc.target/i386/avx512bw-ktestd-1.c: New test. * gcc.target/i386/avx512bw-ktestd-1.c: New test.
......
! { dg-lto-do link }
! { dg-lto-options {{ -Ofast -flto --param ggc-min-expand=0 --param ggc-min-heapsize=0 }} }
! { dg-extra-ld-options "-r -nostdlib" }
MODULE Errorcheck_mod
CONTAINS
SUBROUTINE Check_open(ios, outputstr, errortype)
character(len=*), intent(in) :: outputstr
if (ios > 0 .AND. errortype == FATAL) then
write(*,*) 'The value of ios was:', ios
end if
END SUBROUTINE Check_open
END MODULE Errorcheck_mod
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