+2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * cfgexpand.c (expand_used_vars): Make the type of a local variable auto_vec.
+ * genmatch.c (lower_for): Likewise.
+ * haifa-sched.c (haifa_sched_init): Likewise.
+ (add_to_speculative_block): Likewise.
+ (create_check_block_twin): Likewise.
+ * predict.c (handle_missing_profiles): Likewise.
+ * tree-data-ref.c (loop_nest_has_data_refs): Likewise.
+ * tree-diagnostic.c (maybe_unwind_expanded_macro_loc): Likewise.
+ * tree-ssa-loop-niter.c (discover_iteration_bound_by_body_walk): Likewise.
+ (maybe_lower_iteration_bound): Likewise.
+ * tree-ssa-sccvn.c (DFS): Likewise.
+ * tree-stdarg.c (reachable_at_most_once): Likewise.
+ * tree-vect-stmts.c (vectorizable_conversion): Likewise.
+ (vectorizable_store): Likewise.
+
2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* tree-ssa-sccvn.c (sccvn_dom_walker::~sccvn_dom_walker): remove.
+2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
+
+ * c-parser.c (c_parser_generic_selection): Make type of variable
+ auto_vec.
+ (c_parser_omp_declare_simd): Likewise.
+
2016-07-12 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* c-decl.c (struct c_struct_parse_info): Change member types
static struct c_expr
c_parser_generic_selection (c_parser *parser)
{
- vec<c_generic_association> associations = vNULL;
struct c_expr selector, error_expr;
tree selector_type;
struct c_generic_association matched_assoc;
return error_expr;
}
+ auto_vec<c_generic_association> associations;
while (1)
{
struct c_generic_association assoc, *iter;
if (type_name == NULL)
{
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
- goto error_exit;
+ return error_expr;
}
assoc.type = groktypename (type_name, NULL, NULL);
if (assoc.type == error_mark_node)
{
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
- goto error_exit;
+ return error_expr;
}
if (TREE_CODE (assoc.type) == FUNCTION_TYPE)
if (!c_parser_require (parser, CPP_COLON, "expected %<:%>"))
{
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
- goto error_exit;
+ return error_expr;
}
assoc.expression = c_parser_expr_no_commas (parser, NULL);
if (assoc.expression.value == error_mark_node)
{
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
- goto error_exit;
+ return error_expr;
}
for (ix = 0; associations.iterate (ix, &iter); ++ix)
c_parser_consume_token (parser);
}
- associations.release ();
-
if (!c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>"))
{
c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, NULL);
}
return matched_assoc.expression;
-
- error_exit:
- associations.release ();
- return error_expr;
}
/* Parse a postfix expression (C90 6.3.1-6.3.2, C99 6.5.1-6.5.2).
static void
c_parser_omp_declare_simd (c_parser *parser, enum pragma_context context)
{
- vec<c_token> clauses = vNULL;
+ auto_vec<c_token> clauses;
while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL))
{
c_token *token = c_parser_peek_token (parser);
if (token->type == CPP_EOF)
{
c_parser_skip_to_pragma_eol (parser);
- clauses.release ();
return;
}
clauses.safe_push (*token);
"%<#pragma omp declare simd%> must be followed by "
"function declaration or definition or another "
"%<#pragma omp declare simd%>");
- clauses.release ();
return;
}
c_parser_consume_pragma (parser);
if (token->type == CPP_EOF)
{
c_parser_skip_to_pragma_eol (parser);
- clauses.release ();
return;
}
clauses.safe_push (*token);
default:
gcc_unreachable ();
}
- clauses.release ();
}
/* Finalize #pragma omp declare simd clauses after FNDECL has been parsed,
expand_used_vars (void)
{
tree var, outer_block = DECL_INITIAL (current_function_decl);
- vec<tree> maybe_local_decls = vNULL;
+ auto_vec<tree> maybe_local_decls;
rtx_insn *var_end_seq = NULL;
unsigned i;
unsigned len;
if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT))
add_local_decl (cfun, var);
}
- maybe_local_decls.release ();
/* If the target requires that FRAME_OFFSET be aligned, do it. */
if (STACK_ALIGNMENT_NEEDED)
{
operand *match_op = s->match;
operand *result_op = s->result;
- vec<std::pair<user_id *, id_base *> > subst;
- subst.create (n_ids);
+ auto_vec<std::pair<user_id *, id_base *> > subst (n_ids);
bool skip = false;
for (unsigned i = 0; i < n_ids; ++i)
{
result_op = replace_id (result_op, id, oper);
}
if (skip)
- {
- subst.release ();
- continue;
- }
+ continue;
+
simplify *ns = new simplify (s->kind, match_op, result_op,
vNULL, s->capture_ids);
ns->for_subst_vec.safe_splice (s->for_subst_vec);
if (result_op
&& can_delay_subst)
ns->for_subst_vec.safe_splice (subst);
- else
- subst.release ();
+
worklist.safe_push (ns);
}
}
/* Initialize luids, dependency caches, target and h_i_d for the
whole function. */
{
- bb_vec_t bbs;
- bbs.create (n_basic_blocks_for_fn (cfun));
- basic_block bb;
-
sched_init_bbs ();
+ auto_vec<basic_block> bbs (n_basic_blocks_for_fn (cfun));
+ basic_block bb;
FOR_EACH_BB_FN (bb, cfun)
bbs.quick_push (bb);
sched_init_luids (bbs);
sched_deps_init (true);
sched_extend_target ();
haifa_init_h_i_d (bbs);
-
- bbs.release ();
}
sched_init_only_bb = haifa_init_only_bb;
sd_iterator_def sd_it;
dep_t dep;
rtx_insn_list *twins = NULL;
- rtx_vec_t priorities_roots;
ts = TODO_SPEC (insn);
gcc_assert (!(ts & ~BE_IN_SPEC));
sd_iterator_next (&sd_it);
}
- priorities_roots.create (0);
+ auto_vec<rtx_insn *> priorities_roots;
clear_priorities (insn, &priorities_roots);
while (1)
}
calc_priorities (priorities_roots);
- priorities_roots.release ();
}
/* Extends and fills with zeros (only the new part) array pointed to by P. */
/* Fix priorities. If MUTATE_P is nonzero, this is not necessary,
because it'll be done later in add_to_speculative_block. */
{
- rtx_vec_t priorities_roots = rtx_vec_t ();
+ auto_vec<rtx_insn *> priorities_roots;
clear_priorities (twin, &priorities_roots);
calc_priorities (priorities_roots);
- priorities_roots.release ();
}
}
{
struct cgraph_node *node;
int unlikely_count_fraction = PARAM_VALUE (UNLIKELY_BB_COUNT_FRACTION);
- vec<struct cgraph_node *> worklist;
- worklist.create (64);
+ auto_vec<struct cgraph_node *, 64> worklist;
/* See if 0 count function has non-0 count callers. In this case we
lost some profile. Drop its function profile to PROFILE_GUESSED. */
}
}
}
- worklist.release ();
}
/* Convert counts measured by profile driven feedback to frequencies.
loop_nest_has_data_refs (loop_p loop)
{
basic_block *bbs = get_loop_body (loop);
- vec<data_ref_loc> references;
- references.create (3);
+ auto_vec<data_ref_loc, 3> references;
for (unsigned i = 0; i < loop->num_nodes; i++)
{
if (references.length ())
{
free (bbs);
- references.release ();
return true;
}
}
}
free (bbs);
- references.release ();
if (loop->inner)
{
source_location where)
{
const struct line_map *map;
- vec<loc_map_pair> loc_vec = vNULL;
+ auto_vec<loc_map_pair> loc_vec;
unsigned ix;
loc_map_pair loc, *iter;
"in expansion of macro %qs",
linemap_map_get_macro_name (iter->map));
}
-
- loc_vec.release ();
}
/* This is a diagnostic finalizer implementation that is aware of
discover_iteration_bound_by_body_walk (struct loop *loop)
{
struct nb_iter_bound *elt;
- vec<widest_int> bounds = vNULL;
+ auto_vec<widest_int> bounds;
vec<vec<basic_block> > queues = vNULL;
vec<basic_block> queue = vNULL;
ptrdiff_t queue_index;
}
queues.release ();
- bounds.release ();
}
/* See if every path cross the loop goes through a statement that is known
hash_set<gimple *> *not_executed_last_iteration = NULL;
struct nb_iter_bound *elt;
bool found_exit = false;
- vec<basic_block> queue = vNULL;
+ auto_vec<basic_block> queue;
bitmap visited;
/* Collect all statements with interesting (i.e. lower than
}
BITMAP_FREE (visited);
- queue.release ();
delete not_executed_last_iteration;
}
static bool
DFS (tree name)
{
- vec<ssa_op_iter> itervec = vNULL;
- vec<tree> namevec = vNULL;
+ auto_vec<ssa_op_iter> itervec;
+ auto_vec<tree> namevec;
use_operand_p usep = NULL;
gimple *defstmt;
tree use;
/* See if we found an SCC. */
if (VN_INFO (name)->low == VN_INFO (name)->dfsnum)
if (!extract_and_process_scc_for_name (name))
- {
- namevec.release ();
- itervec.release ();
- return false;
- }
+ return false;
/* Check if we are done. */
if (namevec.is_empty ())
- {
- namevec.release ();
- itervec.release ();
- return true;
- }
+ return true;
/* Restore the last use walker and continue walking there. */
use = name;
static bool
reachable_at_most_once (basic_block va_arg_bb, basic_block va_start_bb)
{
- vec<edge> stack = vNULL;
+ auto_vec<edge, 10> stack;
edge e;
edge_iterator ei;
sbitmap visited;
}
}
- stack.release ();
sbitmap_free (visited);
return ret;
}
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info);
vec_info *vinfo = stmt_info->vinfo;
int multi_step_cvt = 0;
- vec<tree> vec_dsts = vNULL;
vec<tree> interm_types = vNULL;
tree last_oprnd, intermediate_type, cvt_type = NULL_TREE;
int op_type;
We create vector destinations for the intermediate type (TYPES) received
from supportable_*_operation, and store them in the correct order
for future use in vect_create_vectorized_*_stmts (). */
- vec_dsts.create (multi_step_cvt + 1);
+ auto_vec<tree> vec_dsts (multi_step_cvt + 1);
vec_dest = vect_create_destination_var (scalar_dest,
(cvt_type && modifier == WIDEN)
? cvt_type : vectype_out);
vec_oprnds0.release ();
vec_oprnds1.release ();
- vec_dsts.release ();
interm_types.release ();
return true;
gimple *next_stmt, *first_stmt;
bool grouped_store;
unsigned int group_size, i;
- vec<tree> dr_chain = vNULL;
vec<tree> oprnds = vNULL;
vec<tree> result_chain = vNULL;
bool inv_p;
return true;
}
- dr_chain.create (group_size);
+ auto_vec<tree> dr_chain (group_size);
oprnds.create (group_size);
alignment_support_scheme = vect_supportable_dr_alignment (first_dr, false);
}
}
- dr_chain.release ();
oprnds.release ();
result_chain.release ();
vec_oprnds.release ();