From patchwork Tue Nov 20 21:20:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 200520 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 57EF62C00A3 for ; Wed, 21 Nov 2012 08:22:03 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1354051323; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=O1INj/aqj/23OUWFbbrs FI8BXbE=; b=d7RcLI9wcUR00MxYb3kmO4rqCqsCo7+NMb5tnYfbRcgUCkbtgjk3 X23ki8ckEzurwTk910zXfKnANrhOAMcBiHrUz+4d6TS7AUolPjUv7+XB0OoKtg4g TxxM8KP51FRBkPxPLZM1pK6PK8K8HntDW5sLMjtxQ6JRRWGR7RvlYRc= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=oT2nU8uNIBQyixT59JlPv5X1mjn3zyYnFV/Jo7ETW9Wh1+66y852qESKBE0AI3 SoqdREgIRHCIkaGQp6dtf6CRWohxUH61YPEbnSIOr77QoKzYTtQ1FKet4xi7qVcB xJKViJ/1xWDX0QhsGa25PULnow9ZYFwRC5Gw/iF4lVrpU=; Received: (qmail 18087 invoked by alias); 20 Nov 2012 21:21:48 -0000 Received: (qmail 18061 invoked by uid 22791); 20 Nov 2012 21:21:47 -0000 X-SWARE-Spam-Status: No, hits=-0.7 required=5.0 tests=AWL, BAYES_05, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KAM_STOCKTIP, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, TW_BJ, TW_CF, TW_FN, TW_NX, TW_TM, TW_VN, TW_WV X-Spam-Check-By: sourceware.org Received: from mail-gh0-f201.google.com (HELO mail-gh0-f201.google.com) (209.85.160.201) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Nov 2012 21:21:03 +0000 Received: by mail-gh0-f201.google.com with SMTP id z19so513374ghb.2 for ; Tue, 20 Nov 2012 13:21:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:organization:user-agent:x-gm-message-state; bh=n41NlvQ6HjmKjn1lnVKsCAelSLgkRbSlsdPt1ZfeHOo=; b=bLS5B/kYacUVrJs3YWGk3NbW10f5m8Le4Xclw45YoSQ43b5hDRgJlDc52SAxAgsdGo BDr7bJ3oQhfnrqHom7zckuvOZ06zOhL7Ek7esma4NWKV5JTbCGTRgfu2ULjN2b8XgNUS d6E8HRUkOadUET1bIUJEDYNDY4i3QZa4JWObPX59K/s2/Pe9W1hrID/g9hEk4du5PCGl oMyX1XhFLLF6E6gx+kzIiyc4iuv5QJl0UJ1CDxLdlw6POxCPF4NyVwiU4WbP77guWQb3 al9m8PsEHrClBVWYh83eYjzv0uVmJtEEcMuQm+gd/8u/zX3pZBRsDBKZ+6nEctF9TuTe n/+w== Received: by 10.236.151.39 with SMTP id a27mr13142878yhk.42.1353446462389; Tue, 20 Nov 2012 13:21:02 -0800 (PST) Received: from wpzn4.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id j36si580012anp.0.2012.11.20.13.21.02 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 20 Nov 2012 13:21:02 -0800 (PST) Received: from torture.tor.corp.google.com (torture.tor.corp.google.com [172.30.222.16]) by wpzn4.hot.corp.google.com (Postfix) with ESMTP id 269E382004A; Tue, 20 Nov 2012 13:21:02 -0800 (PST) Received: by torture.tor.corp.google.com (Postfix, from userid 54752) id D0041C0585; Tue, 20 Nov 2012 16:20:58 -0500 (EST) Date: Tue, 20 Nov 2012 16:20:58 -0500 From: Diego Novillo To: gcc-patches@gcc.gnu.org, jakub@redhat.com Subject: Add a generic vNULL for initializing vec<> instances Message-ID: <20121120212058.GA19666@google.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQkjP+qvoDnx1NEWau0qlTl44rbwGj66LOE2f9XJfdlhw/l6LkS4JpncmSjbE+zCPqmH9ZmbixbPVNhCrK9P8mucu+PVT+NWKv3ap+soVR97fMxLMrMQuEIzG7Yqcp+6o7py19zYi20ZbeONdizmwKX9kZ2zU0bRDBc6nKoV0a1auH66kEgZUSz7gFl9FDbULDLYVoNYJy8QDUNU53MgCGeOolaadNYH3NBsZyVQ1+2/oLJ09gs= X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch implements Jakub's idea of adding an empty struct with a typecast operator that returns nil vectors. This is useful to shorten all the initializers when declaring vec instances or passing nil vectors as function arguments. Tested on x86_64. Committed. 2012-11-20 Diego Novillo Jakub Jelinek ChangeLog * vec.h (struct vnull): Declare. (vNULL): Declare. * vec.c (vNULL): Define. * bb-reorder.c: Replace all vec() initializers with vNULL. * cfgexpand.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cgraph.c: Likewise. * config/c6x/c6x.c: Likewise. * config/i386/i386.c: Likewise. * df-core.c: Likewise. * dominance.c: Likewise. * dwarf2out.c: Likewise. * except.c: Likewise. * function.c: Likewise. * gcse.c: Likewise. * genautomata.c: Likewise. * graphds.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ira-build.c: Likewise. * lto-cgraph.c: Likewise. * lto-streamer-in.c: Likewise. * lto-symtab.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * ree.c: Likewise. * sched-deps.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * stor-layout.c: Likewise. * trans-mem.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-data-ref.c: Likewise. * tree-diagnostic.c: Likewise. * tree-eh.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-predcom.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-stdarg.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * value-prof.c: Likewise. * varasm.c: Likewise. ada/ChangeLog * gcc-interface/decl.c: Replace all vec() initializers with vNULL. cp/ChangeLog * name-lookup.c: Replace all vec() initializers with vNULL. * semantics.c: Likewise. fortran/ChangeLog * trans-openmp.c: Replace all vec() initializers with vNULL. lto/ChangeLog * lto.c: Replace all vec() initializers with vNULL. objc/ChangeLog * objc-act.c: Replace all vec() initializers with vNULL. diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 91cee82..88afccf 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -3327,7 +3327,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) gnu_variant_list = build_variant_list (TREE_TYPE (gnu_variant_part), gnu_subst_list, - vec()); + vNULL); /* If all the qualifiers are unconditionally true, the innermost variant is statically selected. */ @@ -7552,7 +7552,7 @@ build_position_list (tree gnu_type, bool do_not_flatten_variant, tree gnu_pos, static vec build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition) { - vec gnu_list = vec(); + vec gnu_list = vNULL; Entity_Id gnat_discrim; Node_Id gnat_value; diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c index 433b1a7..ed22bdf 100644 --- a/gcc/bb-reorder.c +++ b/gcc/bb-reorder.c @@ -1461,7 +1461,7 @@ fix_up_crossing_landing_pad (eh_landing_pad old_lp, basic_block old_bb) static vec find_rarely_executed_basic_blocks_and_crossing_edges (void) { - vec crossing_edges = vec(); + vec crossing_edges = vNULL; basic_block bb; edge e; edge_iterator ei; diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 856baa9..083e52a 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1521,7 +1521,7 @@ static rtx expand_used_vars (void) { tree var, outer_block = DECL_INITIAL (current_function_decl); - vec maybe_local_decls = vec(); + vec maybe_local_decls = vNULL; rtx var_end_seq = NULL_RTX; struct pointer_map_t *ssa_name_decls; unsigned i; @@ -1675,8 +1675,8 @@ expand_used_vars (void) { struct stack_vars_data data; - data.asan_vec = vec(); - data.asan_decl_vec = vec(); + data.asan_vec = vNULL; + data.asan_decl_vec = vNULL; /* Reorder decls to be protected by iterating over the variables array multiple times, and allocating out of each phase in turn. */ diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c index 8c5b45a..b45493a 100644 --- a/gcc/cfgloop.c +++ b/gcc/cfgloop.c @@ -92,7 +92,7 @@ get_loop_latch_edges (const struct loop *loop) { edge_iterator ei; edge e; - vec ret = vec(); + vec ret = vNULL; FOR_EACH_EDGE (e, ei, loop->header->preds) { @@ -225,7 +225,7 @@ flow_loops_free (struct loops *loops) int flow_loop_nodes_find (basic_block header, struct loop *loop) { - vec stack = vec(); + vec stack = vNULL; int num_nodes = 1; edge latch; edge_iterator latch_ei; @@ -1117,7 +1117,7 @@ release_recorded_exits (void) vec get_loop_exit_edges (const struct loop *loop) { - vec edges = vec(); + vec edges = vNULL; edge e; unsigned i; basic_block *body; diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c index 9b10284..7fdbd4a 100644 --- a/gcc/cfgloopanal.c +++ b/gcc/cfgloopanal.c @@ -493,7 +493,7 @@ vec get_loop_hot_path (const struct loop *loop) { basic_block bb = loop->header; - vec path = vec(); + vec path = vNULL; bitmap visited = BITMAP_ALLOC (NULL); while (true) diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c index a1972ed..34f7301 100644 --- a/gcc/cfgloopmanip.c +++ b/gcc/cfgloopmanip.c @@ -588,7 +588,7 @@ scale_loop_profile (struct loop *loop, int scale, int iteration_bound) static void update_dominators_in_loop (struct loop *loop) { - vec dom_bbs = vec(); + vec dom_bbs = vNULL; sbitmap seen; basic_block *body; unsigned i; diff --git a/gcc/cgraph.c b/gcc/cgraph.c index c53e51c..3af5456 100644 --- a/gcc/cgraph.c +++ b/gcc/cgraph.c @@ -2184,7 +2184,7 @@ collect_callers_of_node_1 (struct cgraph_node *node, void *data) vec collect_callers_of_node (struct cgraph_node *node) { - vec redirect_callers = vec(); + vec redirect_callers = vNULL; cgraph_for_node_and_aliases (node, collect_callers_of_node_1, &redirect_callers, false); return redirect_callers; diff --git a/gcc/config/c6x/c6x.c b/gcc/config/c6x/c6x.c index 175e119..0c9af2c 100644 --- a/gcc/config/c6x/c6x.c +++ b/gcc/config/c6x/c6x.c @@ -3420,7 +3420,7 @@ try_rename_operands (rtx head, rtx tail, unit_req_table reqs, rtx insn, int i; unsigned tmp_mask; int best_reg, old_reg; - vec involved_chains = vec(); + vec involved_chains = vNULL; unit_req_table new_reqs; for (i = 0, tmp_mask = op_mask; tmp_mask; i++) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index fc75771..c9f027a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -28768,7 +28768,7 @@ dispatch_function_versions (tree dispatch_decl, /* Function version dispatch is via IFUNC. IFUNC resolvers fire before constructors, so explicity call __builtin_cpu_init here. */ ifunc_cpu_init_stmt = gimple_build_call_vec ( - ix86_builtins [(int) IX86_BUILTIN_CPU_INIT], vec()); + ix86_builtins [(int) IX86_BUILTIN_CPU_INIT], vNULL); gimple_seq_add_stmt (&gseq, ifunc_cpu_init_stmt); gimple_set_bb (ifunc_cpu_init_stmt, *empty_bb); set_bb_seq (*empty_bb, gseq); @@ -29275,7 +29275,7 @@ ix86_generate_version_dispatcher_body (void *node_p) { tree resolver_decl; basic_block empty_bb; - vec fn_ver_vec = vec(); + vec fn_ver_vec = vNULL; tree default_ver_decl; struct cgraph_node *versn; struct cgraph_node *node; diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index 5abebe3..87b1f51 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -4222,8 +4222,8 @@ remove_hidden_names (tree fns) void suggest_alternatives_for (location_t location, tree name) { - vec candidates = vec(); - vec namespaces_to_search = vec(); + vec candidates = vNULL; + vec namespaces_to_search = vNULL; int max_to_search = PARAM_VALUE (CXX_MAX_NAMESPACES_FOR_DIAGNOSTIC_HELP); int n_searched = 0; tree t; @@ -5900,7 +5900,7 @@ store_binding (tree id, vec **old_bindings) static void store_bindings (tree names, vec **old_bindings) { - static vec bindings_need_stored = vec(); + static vec bindings_need_stored = vNULL; tree t, id; size_t i; @@ -5936,7 +5936,7 @@ static void store_class_bindings (vec *names, vec **old_bindings) { - static vec bindings_need_stored = vec(); + static vec bindings_need_stored = vNULL; size_t i; cp_class_binding *cb; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index bbafa3a..74b897c 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -6510,7 +6510,7 @@ cxx_bind_parameters_in_call (const constexpr_call *old_call, tree t, These do not need to be marked for PCH or GC. */ /* FIXME remember and print actual constant arguments. */ -static vec call_stack = vec(); +static vec call_stack = vNULL; static int call_stack_tick; static int last_cx_error_tick; @@ -6536,7 +6536,7 @@ pop_cx_call_context (void) vec cx_error_context (void) { - vec r = vec(); + vec r = vNULL; if (call_stack_tick != last_cx_error_tick && !call_stack.is_empty ()) r = call_stack; diff --git a/gcc/df-core.c b/gcc/df-core.c index 94b10d3..9218cb6 100644 --- a/gcc/df-core.c +++ b/gcc/df-core.c @@ -991,7 +991,7 @@ df_worklist_dataflow_doublequeue (struct dataflow *dataflow, bitmap worklist = BITMAP_ALLOC (&df_bitmap_obstack); int age = 0; bool changed; - vec last_visit_age = vec(); + vec last_visit_age = vNULL; int prev_age; basic_block bb; int i; diff --git a/gcc/dominance.c b/gcc/dominance.c index 4168fde..0f1e265 100644 --- a/gcc/dominance.c +++ b/gcc/dominance.c @@ -745,12 +745,12 @@ get_dominated_by (enum cdi_direction dir, basic_block bb) { unsigned int dir_index = dom_convert_dir_to_idx (dir); struct et_node *node = bb->dom[dir_index], *son = node->son, *ason; - vec bbs = vec(); + vec bbs = vNULL; gcc_checking_assert (dom_computed[dir_index]); if (!son) - return vec(); + return vNULL; bbs.safe_push ((basic_block) son->data); for (ason = son->right; ason != son; ason = ason->right) @@ -769,7 +769,7 @@ get_dominated_by_region (enum cdi_direction dir, basic_block *region, { unsigned i; basic_block dom; - vec doms = vec(); + vec doms = vNULL; for (i = 0; i < n_region; i++) region[i]->flags |= BB_DUPLICATED; @@ -793,7 +793,7 @@ get_dominated_by_region (enum cdi_direction dir, basic_block *region, vec get_dominated_to_depth (enum cdi_direction dir, basic_block bb, int depth) { - vec bbs = vec(); + vec bbs = vNULL; unsigned i; unsigned next_level_start; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c25b7b7..f0256ae 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -18740,7 +18740,7 @@ static char * gen_producer_string (void) { size_t j; - vec switches = vec(); + vec switches = vNULL; const char *language_string = lang_hooks.name; char *producer, *tail; const char *p; diff --git a/gcc/except.c b/gcc/except.c index c0ac835..287b75b 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -1239,7 +1239,7 @@ sjlj_emit_dispatch_table (rtx dispatch_label, int num_dispatch) eh_region r; edge e; int i, disp_index; - vec dispatch_labels = vec(); + vec dispatch_labels = vNULL; fc = crtl->eh.sjlj_fc; diff --git a/gcc/fortran/trans-openmp.c b/gcc/fortran/trans-openmp.c index a844b08..8e44338 100644 --- a/gcc/fortran/trans-openmp.c +++ b/gcc/fortran/trans-openmp.c @@ -1305,7 +1305,7 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock, stmtblock_t body; gfc_omp_clauses *clauses = code->ext.omp_clauses; int i, collapse = clauses->collapse; - vec inits = vec(); + vec inits = vNULL; dovar_init *di; unsigned ix; diff --git a/gcc/function.c b/gcc/function.c index 876e1c6..9a8e0ae 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -2265,7 +2265,7 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all) { tree fndecl = current_function_decl; tree fntype = TREE_TYPE (fndecl); - vec fnargs = vec(); + vec fnargs = vNULL; tree arg; for (arg = DECL_ARGUMENTS (fndecl); arg; arg = DECL_CHAIN (arg)) @@ -5874,7 +5874,7 @@ thread_prologue_and_epilogue_insns (void) { bool inserted; #ifdef HAVE_simple_return - vec unconverted_simple_returns = vec(); + vec unconverted_simple_returns = vNULL; bool nonempty_prologue; bitmap_head bb_flags; unsigned max_grow_size; @@ -6374,7 +6374,7 @@ thread_prologue_and_epilogue_insns (void) if (LABEL_P (BB_HEAD (last_bb)) && !active_insn_between (BB_HEAD (last_bb), BB_END (last_bb))) - convert_jumps_to_returns (last_bb, false, vec()); + convert_jumps_to_returns (last_bb, false, vNULL); if (EDGE_COUNT (last_bb->preds) != 0 && single_succ_p (last_bb)) diff --git a/gcc/gcse.c b/gcc/gcse.c index 4be7cdc..ad09afd 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -3193,7 +3193,7 @@ hoist_code (void) /* Number of occurrences of EXPR that can be hoisted to BB. */ int hoistable = 0; /* Occurrences reachable from BB. */ - vec occrs_to_hoist = vec(); + vec occrs_to_hoist = vNULL; /* We want to insert the expression into BB only once, so note when we've inserted it. */ int insn_inserted_p; diff --git a/gcc/genautomata.c b/gcc/genautomata.c index faa9bf8..8d93f0e 100644 --- a/gcc/genautomata.c +++ b/gcc/genautomata.c @@ -6255,7 +6255,7 @@ set_new_cycle_flags (state_t state) static void minimize_DFA (automaton_t automaton) { - vec equiv_classes = vec(); + vec equiv_classes = vNULL; evaluate_equiv_classes (automaton, &equiv_classes); merge_states (automaton, equiv_classes); diff --git a/gcc/graphds.c b/gcc/graphds.c index 1614b15..beaef16 100644 --- a/gcc/graphds.c +++ b/gcc/graphds.c @@ -274,7 +274,7 @@ int graphds_scc (struct graph *g, bitmap subgraph) { int *queue = XNEWVEC (int, g->n_vertices); - vec postorder = vec(); + vec postorder = vNULL; int nq, i, comp; unsigned v; bitmap_iterator bi; @@ -400,7 +400,7 @@ void graphds_domtree (struct graph *g, int entry, int *parent, int *son, int *brother) { - vec postorder = vec(); + vec postorder = vNULL; int *marks = XCNEWVEC (int, g->n_vertices); int mark = 1, i, v, idom; bool changed = true; diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index c641358..d6bb0db 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -267,7 +267,7 @@ stmt_has_simple_data_refs_p (loop_p outermost_loop ATTRIBUTE_UNUSED, unsigned i; int j; bool res = true; - vec drs = vec(); + vec drs = vNULL; loop_p outer; for (outer = loop_containing_stmt (stmt); outer; outer = loop_outer (outer)) @@ -1585,7 +1585,7 @@ dot_all_scops (vec scops) DEBUG_FUNCTION void dot_scop (scop_p scop) { - vec scops = vec(); + vec scops = vNULL; if (scop) scops.safe_push (scop); diff --git a/gcc/graphite.c b/gcc/graphite.c index beb94a7..b45659c 100644 --- a/gcc/graphite.c +++ b/gcc/graphite.c @@ -255,7 +255,7 @@ graphite_transform_loops (void) int i; scop_p scop; bool need_cfg_cleanup_p = false; - vec scops = vec(); + vec scops = vNULL; htab_t bb_pbb_mapping; isl_ctx *ctx; diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 48e15f8..40350eb 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -383,13 +383,13 @@ const struct common_sched_info_def haifa_common_sched_info = }; /* Mapping from instruction UID to its Logical UID. */ -vec sched_luids = vec(); +vec sched_luids = vNULL; /* Next LUID to assign to an instruction. */ int sched_max_luid = 1; /* Haifa Instruction Data. */ -vec h_i_d = vec(); +vec h_i_d = vNULL; void (* sched_init_only_bb) (basic_block, basic_block); @@ -4187,7 +4187,7 @@ undo_replacements_for_backtrack (struct haifa_saved_data *save) static void unschedule_insns_until (rtx insn) { - vec recompute_vec = vec(); + vec recompute_vec = vNULL; /* Make two passes over the insns to be unscheduled. First, we clear out dependencies and other trivial bookkeeping. */ diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c index f9ddfd6..b518b0e 100644 --- a/gcc/ifcvt.c +++ b/gcc/ifcvt.c @@ -2850,8 +2850,8 @@ cond_move_process_if_block (struct noce_if_info *if_info) int c; struct pointer_map_t *then_vals; struct pointer_map_t *else_vals; - vec then_regs = vec(); - vec else_regs = vec(); + vec then_regs = vNULL; + vec else_regs = vNULL; unsigned int i; int success_p = FALSE; diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index a0f5f5f..c22f63b 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -1575,7 +1575,7 @@ devirtualization_time_bonus (struct cgraph_node *node, tree target; target = ipa_get_indirect_edge_target (ie, known_csts, known_binfos, - vec()); + vNULL); if (!target) continue; @@ -2248,9 +2248,7 @@ ipcp_discover_new_direct_edges (struct cgraph_node *node, tree target; next_ie = ie->next_callee; - target = ipa_get_indirect_edge_target (ie, known_vals, - vec(), - vec()); + target = ipa_get_indirect_edge_target (ie, known_vals, vNULL, vNULL); if (target) { ipa_make_edge_direct_to_target (ie, target); @@ -2731,10 +2729,10 @@ find_more_scalar_values_for_callers_subset (struct cgraph_node *node, static vec copy_plats_to_inter (struct ipcp_param_lattices *plats, HOST_WIDE_INT offset) { - vec res = vec(); + vec res = vNULL; if (!plats->aggs || plats->aggs_contain_variable || plats->aggs_bottom) - return vec(); + return vNULL; for (struct ipcp_agg_lattice *aglat = plats->aggs; aglat; aglat = aglat->next) if (ipa_lat_is_single_const (aglat)) @@ -2796,7 +2794,7 @@ static vec agg_replacements_to_vector (struct cgraph_node *node, HOST_WIDE_INT offset) { struct ipa_agg_replacement_value *av; - vec res = vec(); + vec res = vNULL; for (av = ipa_get_agg_replacements_for_node (node); av; av = av->next) { @@ -2874,7 +2872,7 @@ find_aggregate_values_for_callers_subset (struct cgraph_node *node, for (i = 0; i < count ; i++) { struct cgraph_edge *cs; - vec inter = vec(); + vec inter = vNULL; struct ipa_agg_jf_item *item; int j; @@ -3283,7 +3281,7 @@ decide_whether_version_node (struct cgraph_node *node) struct ipa_node_params *info = IPA_NODE_REF (node); int i, count = ipa_get_param_count (info); vec known_csts, known_binfos; - vec known_aggs = vec(); + vec known_aggs = vNULL; bool ret = false; if (count == 0) diff --git a/gcc/ipa-inline-analysis.c b/gcc/ipa-inline-analysis.c index 61fb48d..8f5b1f2 100644 --- a/gcc/ipa-inline-analysis.c +++ b/gcc/ipa-inline-analysis.c @@ -848,9 +848,8 @@ evaluate_properties_for_edge (struct cgraph_edge *e, bool inline_p, { struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL); struct inline_summary *info = inline_summary (callee); - vec known_vals = vec(); - vec known_aggs - = vec(); + vec known_vals = vNULL; + vec known_aggs = vNULL; if (clause_ptr) *clause_ptr = inline_p ? 0 : 1 << predicate_not_inlined_condition; @@ -1086,7 +1085,7 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst, vec *entry = info->entry; /* Use SRC parm info since it may not be copied yet. */ struct ipa_node_params *parms_info = IPA_NODE_REF (src); - vec known_vals = vec(); + vec known_vals = vNULL; int count = ipa_get_param_count (parms_info); int i,j; clause_t possible_truths; @@ -1115,8 +1114,7 @@ inline_node_duplication_hook (struct cgraph_node *src, struct cgraph_node *dst, } } possible_truths = evaluate_conditions_for_known_args (dst, false, - known_vals, - vec()); + known_vals, vNULL); known_vals.release (); account_size_time (info, 0, 0, &true_pred); @@ -2290,7 +2288,7 @@ estimate_function_body_sizes (struct cgraph_node *node, bool early) struct inline_summary *info = inline_summary (node); struct predicate bb_predicate; struct ipa_node_params *parms_info = NULL; - vec nonconstant_names = vec(); + vec nonconstant_names = vNULL; int nblocks, n; int *order; predicate array_index = true_predicate (); @@ -2962,8 +2960,7 @@ estimate_ipcp_clone_size_and_time (struct cgraph_node *node, clause = evaluate_conditions_for_known_args (node, false, known_vals, known_aggs); estimate_node_size_and_time (node, clause, known_vals, known_binfos, - known_aggs, ret_size, ret_time, hints, - vec()); + known_aggs, ret_size, ret_time, hints, vNULL); } /* Translate all conditions from callee representation into caller @@ -3255,8 +3252,8 @@ inline_merge_summary (struct cgraph_edge *edge) struct inline_summary *info = inline_summary (to); clause_t clause = 0; /* not_inline is known to be false. */ size_time_entry *e; - vec operand_map = vec(); - vec offset_map = vec(); + vec operand_map = vNULL; + vec offset_map = vNULL; int i; struct predicate toplev_predicate; struct predicate true_p = true_predicate (); @@ -3378,9 +3375,7 @@ inline_update_overall_summary (struct cgraph_node *node) } estimate_calls_size_and_time (node, &info->size, &info->time, NULL, ~(clause_t)(1 << predicate_false_condition), - vec(), - vec(), - vec()); + vNULL, vNULL, vNULL); info->time = (info->time + INLINE_TIME_SCALE / 2) / INLINE_TIME_SCALE; info->size = (info->size + INLINE_SIZE_SCALE / 2) / INLINE_SIZE_SCALE; } @@ -3485,8 +3480,7 @@ do_estimate_edge_size (struct cgraph_edge *edge) &clause, &known_vals, &known_binfos, &known_aggs); estimate_node_size_and_time (callee, clause, known_vals, known_binfos, - known_aggs, &size, NULL, NULL, - vec()); + known_aggs, &size, NULL, NULL, vNULL); known_vals.release (); known_binfos.release (); known_aggs.release (); @@ -3525,8 +3519,7 @@ do_estimate_edge_hints (struct cgraph_edge *edge) &clause, &known_vals, &known_binfos, &known_aggs); estimate_node_size_and_time (callee, clause, known_vals, known_binfos, - known_aggs, NULL, NULL, &hints, - vec()); + known_aggs, NULL, NULL, &hints, vNULL); known_vals.release (); known_binfos.release (); known_aggs.release (); @@ -3775,8 +3768,7 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data, data_in = lto_data_in_create (file_data, (const char *) data + string_offset, - header->string_size, - vec()); + header->string_size, vNULL); f_count = streamer_read_uhwi (&ib); for (i = 0; i < f_count; i++) { diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c index 19b2c85..84f4fcc 100644 --- a/gcc/ipa-inline-transform.c +++ b/gcc/ipa-inline-transform.c @@ -171,8 +171,7 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, struct cgraph_node *n; n = cgraph_clone_node (e->callee, e->callee->symbol.decl, e->count, e->frequency, - update_original, vec(), - true); + update_original, vNULL, true); cgraph_redirect_edge_callee (e, n); } } diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index 14e8256..5013588 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1313,8 +1313,7 @@ recursive_inlining (struct cgraph_edge *edge, /* We need original clone to copy around. */ master_clone = cgraph_clone_node (node, node->symbol.decl, node->count, CGRAPH_FREQ_BASE, - false, vec(), - true); + false, vNULL, true); for (e = master_clone->callees; e; e = e->next_callee) if (!e->inline_failed) clone_inlined_nodes (e, true, false, NULL); @@ -1403,7 +1402,7 @@ inline_small_functions (void) fibheap_t edge_heap = fibheap_new (); bitmap updated_nodes = BITMAP_ALLOC (NULL); int min_size, max_size; - vec new_indirect_edges = vec(); + vec new_indirect_edges = vNULL; int initial_size = 0; struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes); diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 3150bd6..b7da254 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -3534,8 +3534,7 @@ ipa_prop_read_section (struct lto_file_decl_data *file_data, const char *data, data_in = lto_data_in_create (file_data, (const char *) data + string_offset, - header->string_size, - vec()); + header->string_size, vNULL); count = streamer_read_uhwi (&ib_main); for (i = 0; i < count; i++) @@ -3708,8 +3707,7 @@ read_replacements_section (struct lto_file_decl_data *file_data, header->main_size); data_in = lto_data_in_create (file_data, (const char *) data + string_offset, - header->string_size, - vec()); + header->string_size, vNULL); count = streamer_read_uhwi (&ib_main); for (i = 0; i < count; i++) @@ -3790,7 +3788,7 @@ adjust_agg_replacement_values (struct cgraph_node *node, unsigned int ipcp_transform_function (struct cgraph_node *node) { - vec descriptors = vec(); + vec descriptors = vNULL; struct param_analysis_info *parms_ainfo; struct ipa_agg_replacement_value *aggval; gimple_stmt_iterator gsi; diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c index ceed8d2..f6b469a 100644 --- a/gcc/ipa-split.c +++ b/gcc/ipa-split.c @@ -190,7 +190,7 @@ verify_non_ssa_vars (struct split_point *current, bitmap non_ssa_vars, basic_block return_bb) { bitmap seen = BITMAP_ALLOC (NULL); - vec worklist = vec(); + vec worklist = vNULL; edge e; edge_iterator ei; bool ok = true; @@ -889,7 +889,7 @@ static void find_split_points (int overall_time, int overall_size) { stack_entry first; - vec stack = vec(); + vec stack = vNULL; basic_block bb; basic_block return_bb = find_return_bb (); struct split_point current; @@ -1038,7 +1038,7 @@ find_split_points (int overall_time, int overall_size) static void split_function (struct split_point *split_point) { - vec args_to_pass = vec(); + vec args_to_pass = vNULL; bitmap args_to_skip; tree parm; int num = 0; @@ -1183,7 +1183,7 @@ split_function (struct split_point *split_point) /* Now create the actual clone. */ rebuild_cgraph_edges (); - node = cgraph_function_versioning (cur_node, vec(), + node = cgraph_function_versioning (cur_node, vNULL, NULL, args_to_skip, !split_part_return_p, diff --git a/gcc/ipa-utils.c b/gcc/ipa-utils.c index d133f79..ba15e36 100644 --- a/gcc/ipa-utils.c +++ b/gcc/ipa-utils.c @@ -240,7 +240,7 @@ ipa_free_postorder_info (void) vec ipa_get_nodes_in_cycle (struct cgraph_node *node) { - vec v = vec(); + vec v = vNULL; struct ipa_dfs_info *node_dfs_info; while (node) { diff --git a/gcc/ira-build.c b/gcc/ira-build.c index e0b9c1b..9cd1016 100644 --- a/gcc/ira-build.c +++ b/gcc/ira-build.c @@ -1475,7 +1475,7 @@ static vec ira_loop_tree_body_rev_postorder (ira_loop_tree_node_t loop_node ATTRIBUTE_UNUSED, vec loop_preorder) { - vec topsort_nodes = vec(); + vec topsort_nodes = vNULL; unsigned int n_loop_preorder; n_loop_preorder = loop_preorder.length (); @@ -1580,7 +1580,7 @@ ira_traverse_loop_tree (bool bb_p, ira_loop_tree_node_t loop_node, if (bb_p) { vec - loop_preorder = vec(); + loop_preorder = vNULL; unsigned int i; /* Add all nodes to the set of nodes to visit. The IRA loop tree diff --git a/gcc/lto-cgraph.c b/gcc/lto-cgraph.c index 7d936ef..4273622 100644 --- a/gcc/lto-cgraph.c +++ b/gcc/lto-cgraph.c @@ -913,7 +913,7 @@ input_node (struct lto_file_decl_data *file_data, { node = cgraph_clone_node (cgraph (nodes[clone_ref]), fn_decl, 0, CGRAPH_FREQ_BASE, false, - vec(), false); + vNULL, false); } else node = cgraph_get_create_node (fn_decl); @@ -926,7 +926,7 @@ input_node (struct lto_file_decl_data *file_data, node->count_materialization_scale = streamer_read_hwi (ib); count = streamer_read_hwi (ib); - node->ipa_transforms_to_apply = vec(); + node->ipa_transforms_to_apply = vNULL; for (i = 0; i < count; i++) { struct opt_pass *pass; @@ -1126,7 +1126,7 @@ input_cgraph_1 (struct lto_file_decl_data *file_data, struct lto_input_block *ib) { enum LTO_symtab_tags tag; - vec nodes = vec(); + vec nodes = vNULL; symtab_node node; unsigned i; @@ -1573,8 +1573,7 @@ input_cgraph_opt_section (struct lto_file_decl_data *file_data, data_in = lto_data_in_create (file_data, (const char *) data + string_offset, - header->string_size, - vec()); + header->string_size, vNULL); count = streamer_read_uhwi (&ib_main); for (i = 0; i < count; i++) diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 2c5a760..e262925 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -925,8 +925,7 @@ lto_read_body (struct lto_file_decl_data *file_data, tree fn_decl, header->main_size); data_in = lto_data_in_create (file_data, data + string_offset, - header->string_size, - vec()); + header->string_size, vNULL); /* Make sure the file was generated by the exact same compiler. */ lto_check_version (header->lto_header.major_version, @@ -1124,8 +1123,7 @@ lto_input_toplevel_asms (struct lto_file_decl_data *file_data, int order_base) header->main_size); data_in = lto_data_in_create (file_data, data + string_offset, - header->string_size, - vec()); + header->string_size, vNULL); /* Make sure the file was generated by the exact same compiler. */ lto_check_version (header->lto_header.major_version, diff --git a/gcc/lto-symtab.c b/gcc/lto-symtab.c index bee26f1..0b0cdac 100644 --- a/gcc/lto-symtab.c +++ b/gcc/lto-symtab.c @@ -353,7 +353,7 @@ static void lto_symtab_merge_decls_2 (symtab_node first, bool diagnosed_p) { symtab_node prevailing, e; - vec mismatches = vec(); + vec mismatches = vNULL; unsigned i; tree decl; diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index da55b7e..376af85 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -873,7 +873,7 @@ pop: static bool gimple_types_compatible_p (tree t1, tree t2) { - vec sccstack = vec(); + vec sccstack = vNULL; struct pointer_map_t *sccstate; struct obstack sccstate_obstack; type_pair_t p = NULL; @@ -1298,7 +1298,7 @@ static hashval_t gimple_type_hash (const void *p) { const_tree t = (const_tree) p; - vec sccstack = vec(); + vec sccstack = vNULL; struct pointer_map_t *sccstate; struct obstack sccstate_obstack; hashval_t val; @@ -2318,7 +2318,7 @@ lto_file_finalize (struct lto_file_decl_data *file_data, lto_file *file) const char *data; size_t len; vec - resolutions = vec(); + resolutions = vNULL; int i; res_pair *rp; diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 3ef84cd..816e339 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -2067,7 +2067,7 @@ objc_build_struct (tree klass, tree fields, tree super_name) tree s = objc_start_struct (name); tree super = (super_name ? xref_tag (RECORD_TYPE, super_name) : NULL_TREE); tree t; - vec objc_info = vec(); + vec objc_info = vNULL; int i; if (super) diff --git a/gcc/opts-global.c b/gcc/opts-global.c index 38cd62b..6409ea7 100644 --- a/gcc/opts-global.c +++ b/gcc/opts-global.c @@ -353,7 +353,7 @@ handle_common_deferred_options (void) if (common_deferred_options) v = *((vec *) common_deferred_options); else - v = vec(); + v = vNULL; if (flag_dump_all_passed) enable_rtl_dump_file (); diff --git a/gcc/passes.c b/gcc/passes.c index 7e224fb..909f49e 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -633,7 +633,7 @@ register_pass_name (struct opt_pass *pass, const char *name) /* Map from pass id to canonicalized pass name. */ typedef const char *char_ptr; -static vec pass_tab = vec(); +static vec pass_tab = vNULL; /* Callback function for traversing NAME_TO_PASS_MAP. */ @@ -770,9 +770,9 @@ typedef struct uid_range *uid_range_p; static vec - enabled_pass_uid_range_tab = vec(); + enabled_pass_uid_range_tab = vNULL; static vec - disabled_pass_uid_range_tab = vec(); + disabled_pass_uid_range_tab = vNULL; /* Parse option string for -fdisable- and -fenable- diff --git a/gcc/ree.c b/gcc/ree.c index 0279b3d..63f84cb 100644 --- a/gcc/ree.c +++ b/gcc/ree.c @@ -829,7 +829,7 @@ add_removable_extension (const_rtx expr, rtx insn, static vec find_removable_extensions (void) { - vec insn_list = vec(); + vec insn_list = vNULL; basic_block bb; rtx insn, set; unsigned *def_map = XCNEWVEC (unsigned, max_insn_uid); diff --git a/gcc/sched-deps.c b/gcc/sched-deps.c index 52e15413..f8b124d 100644 --- a/gcc/sched-deps.c +++ b/gcc/sched-deps.c @@ -59,7 +59,7 @@ struct sched_deps_info_def *sched_deps_info; /* The data is specific to the Haifa scheduler. */ vec - h_d_i_d = vec(); + h_d_i_d = vNULL; /* Return the major type present in the DS. */ enum reg_note diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index e592929..2c0403c 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -50,11 +50,11 @@ along with GCC; see the file COPYING3. If not see /* A vector holding bb info for whole scheduling pass. */ vec - sel_global_bb_info = vec(); + sel_global_bb_info = vNULL; /* A vector holding bb info. */ vec - sel_region_bb_info = vec(); + sel_region_bb_info = vNULL; /* A pool for allocating all lists. */ alloc_pool sched_lists_pool; @@ -70,7 +70,7 @@ struct loop *current_loop_nest; /* LOOP_NESTS is a vector containing the corresponding loop nest for each region. */ -static vec loop_nests = vec(); +static vec loop_nests = vNULL; /* Saves blocks already in loop regions, indexed by bb->index. */ static sbitmap bbs_in_loop_rgns = NULL; @@ -1652,7 +1652,7 @@ init_expr (expr_t expr, vinsn_t vi, int spec, int use, int priority, void copy_expr (expr_t to, expr_t from) { - vec temp = vec(); + vec temp = vNULL; if (EXPR_HISTORY_OF_CHANGES (from).exists ()) { @@ -1687,7 +1687,7 @@ copy_expr_onside (expr_t to, expr_t from) init_expr (to, EXPR_VINSN (from), EXPR_SPEC (from), EXPR_USEFULNESS (from), EXPR_PRIORITY (from), EXPR_SCHED_TIMES (from), 0, EXPR_SPEC_DONE_DS (from), EXPR_SPEC_TO_CHECK_DS (from), 0, - vec(), + vNULL, EXPR_TARGET_AVAILABLE (from), EXPR_WAS_SUBSTITUTED (from), EXPR_WAS_RENAMED (from), EXPR_NEEDS_SPEC_CHECK_P (from), EXPR_CANT_MOVE (from)); @@ -3004,7 +3004,7 @@ init_global_and_expr_for_insn (insn_t insn) /* Initialize INSN's expr. */ init_expr (INSN_EXPR (insn), vinsn_create (insn, force_unique_p), 0, REG_BR_PROB_BASE, INSN_PRIORITY (insn), 0, BLOCK_NUM (insn), - spec_done_ds, 0, 0, vec(), true, + spec_done_ds, 0, 0, vNULL, true, false, false, false, CANT_MOVE (insn)); } @@ -4135,7 +4135,7 @@ finish_region_bb_info (void) /* Data for each insn in current region. */ -vec s_i_d = vec(); +vec s_i_d = vNULL; /* Extend data structures for insns from current region. */ static void @@ -4253,7 +4253,7 @@ init_simplejump_data (insn_t insn) { init_expr (INSN_EXPR (insn), vinsn_create (insn, false), 0, REG_BR_PROB_BASE, 0, 0, 0, 0, 0, 0, - vec(), true, false, false, + vNULL, true, false, false, false, true); INSN_SEQNO (insn) = get_seqno_for_a_jump (insn); init_first_time_insn_data (insn); @@ -4504,7 +4504,7 @@ get_av_level (insn_t insn) /* The basic block that already has been processed by the sched_data_update (), but hasn't been in sel_add_bb () yet. */ static vec - last_added_blocks = vec(); + last_added_blocks = vNULL; /* A pool for allocating successor infos. */ static struct diff --git a/gcc/sel-sched-ir.h b/gcc/sel-sched-ir.h index 0471423..ddcfeef 100644 --- a/gcc/sel-sched-ir.h +++ b/gcc/sel-sched-ir.h @@ -1050,7 +1050,7 @@ inner_loop_header_p (basic_block bb) static inline vec get_loop_exit_edges_unique_dests (const struct loop *loop) { - vec edges = vec(); + vec edges = vNULL; struct loop_exit *exit; gcc_assert (loop->latch != EXIT_BLOCK_PTR @@ -1104,7 +1104,7 @@ sel_bb_empty_or_nop_p (basic_block bb) static inline vec get_all_loop_exits (basic_block bb) { - vec exits = vec(); + vec exits = vNULL; /* If bb is empty, and we're skipping to loop exits, then consider bb as a possible gate to the inner loop now. */ diff --git a/gcc/sel-sched.c b/gcc/sel-sched.c index f1d1a77..6fe11b2 100644 --- a/gcc/sel-sched.c +++ b/gcc/sel-sched.c @@ -500,7 +500,7 @@ static int max_ws; static int num_insns_scheduled; /* A vector of expressions is used to be able to sort them. */ -static vec vec_av_set = vec(); +static vec vec_av_set = vNULL; /* A vector of vinsns is used to hold temporary lists of vinsns. */ typedef vec vinsn_vec_t; @@ -518,7 +518,7 @@ static vinsn_vec_t vec_target_unavailable_vinsns = vinsn_vec_t(); /* Vector to store temporary nops inserted in move_op to prevent removal of empty bbs. */ -static vec vec_temp_moveop_nops = vec(); +static vec vec_temp_moveop_nops = vNULL; /* These bitmaps record original instructions scheduled on the current iteration and bookkeeping copies created by them. */ diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 4735724..03da59e 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -189,7 +189,7 @@ static tree self_referential_size (tree size) { static unsigned HOST_WIDE_INT fnno = 0; - vec self_refs = vec(); + vec self_refs = vNULL; tree param_type_list = NULL, param_decl_list = NULL; tree t, ref, return_type, fntype, fnname, fndecl; unsigned int i; diff --git a/gcc/trans-mem.c b/gcc/trans-mem.c index 79be8b9..0a428fe 100644 --- a/gcc/trans-mem.c +++ b/gcc/trans-mem.c @@ -1841,10 +1841,10 @@ tm_region_init (struct tm_region *region) edge_iterator ei; edge e; basic_block bb; - vec queue = vec(); + vec queue = vNULL; bitmap visited_blocks = BITMAP_ALLOC (NULL); struct tm_region *old_region; - vec bb_regions = vec(); + vec bb_regions = vNULL; all_tm_regions = region; bb = single_succ (ENTRY_BLOCK_PTR); @@ -2403,7 +2403,7 @@ get_tm_region_blocks (basic_block entry_block, bitmap all_region_blocks, bool stop_at_irrevocable_p) { - vec bbs = vec(); + vec bbs = vNULL; unsigned i; edge e; edge_iterator ei; @@ -4689,9 +4689,7 @@ ipa_tm_create_version (struct cgraph_node *old_node) if (DECL_ONE_ONLY (new_decl)) DECL_COMDAT_GROUP (new_decl) = tm_mangle (DECL_COMDAT_GROUP (old_decl)); - new_node = cgraph_copy_node_for_versioning (old_node, new_decl, - vec(), - NULL); + new_node = cgraph_copy_node_for_versioning (old_node, new_decl, vNULL, NULL); new_node->symbol.externally_visible = old_node->symbol.externally_visible; new_node->lowered = true; new_node->tm_clone = 1; @@ -4980,7 +4978,7 @@ ipa_tm_transform_calls (struct cgraph_node *node, struct tm_region *region, bool need_ssa_rename = false; edge e; edge_iterator ei; - vec queue = vec(); + vec queue = vNULL; bitmap visited_blocks = BITMAP_ALLOC (NULL); queue.safe_push (bb); diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index 42f4752..273aed2 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -861,7 +861,7 @@ tree_call_cdce (void) basic_block bb; gimple_stmt_iterator i; bool something_changed = false; - vec cond_dead_built_in_calls = vec(); + vec cond_dead_built_in_calls = vNULL; FOR_EACH_BB (bb) { /* Collect dead call candidates. */ diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index eaf59ea..169a205 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -7269,8 +7269,8 @@ gimple_flow_call_edges_add (sbitmap blocks) void remove_edge_and_dominated_blocks (edge e) { - vec bbs_to_remove = vec(); - vec bbs_to_fix_dom = vec(); + vec bbs_to_remove = vNULL; + vec bbs_to_fix_dom = vNULL; bitmap df, df_idom; edge f; edge_iterator ei; diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c index 458362c..7e95ad7 100644 --- a/gcc/tree-data-ref.c +++ b/gcc/tree-data-ref.c @@ -820,7 +820,7 @@ dr_analyze_innermost (struct data_reference *dr, struct loop *nest) static void dr_analyze_indices (struct data_reference *dr, loop_p nest, loop_p loop) { - vec access_fns = vec(); + vec access_fns = vNULL; tree ref, op; tree base, off, access_fn; basic_block before_loop; @@ -4615,8 +4615,7 @@ compute_data_dependences_for_bb (basic_block bb, if (find_data_references_in_bb (NULL, bb, datarefs) == chrec_dont_know) return false; - return compute_all_dependences (*datarefs, dependence_relations, - vec(), + return compute_all_dependences (*datarefs, dependence_relations, vNULL, compute_self_and_read_read_dependences); } diff --git a/gcc/tree-diagnostic.c b/gcc/tree-diagnostic.c index 788b118..7c63069 100644 --- a/gcc/tree-diagnostic.c +++ b/gcc/tree-diagnostic.c @@ -104,7 +104,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context, source_location where) { const struct line_map *map; - vec loc_vec = vec(); + vec loc_vec = vNULL; unsigned ix; loc_map_pair loc, *iter; diff --git a/gcc/tree-eh.c b/gcc/tree-eh.c index 922fcfe..8cc624b 100644 --- a/gcc/tree-eh.c +++ b/gcc/tree-eh.c @@ -3332,7 +3332,7 @@ lower_eh_dispatch (basic_block src, gimple stmt) { case ERT_TRY: { - vec labels = vec(); + vec labels = vNULL; tree default_label = NULL; eh_catch c; edge_iterator ei; diff --git a/gcc/tree-loop-distribution.c b/gcc/tree-loop-distribution.c index a0a766b..33d4c45 100644 --- a/gcc/tree-loop-distribution.c +++ b/gcc/tree-loop-distribution.c @@ -1020,7 +1020,7 @@ classify_partition (loop_p loop, struct graph *rdg, partition_t partition) return; /* Now check that if there is a dependence this dependence is of a suitable form for memmove. */ - vec loops = vec(); + vec loops = vNULL; ddr_p ddr; loops.safe_push (loop); ddr = initialize_data_dependence_relation (single_load, single_store, @@ -1506,7 +1506,7 @@ tree_loop_distribution (void) walking to innermost loops. */ FOR_EACH_LOOP (li, loop, LI_ONLY_INNERMOST) { - vec work_list = vec(); + vec work_list = vNULL; basic_block *bbs; int num = loop->num; int nb_generated_loops = 0; diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index b1dce08..1338a04 100644 --- a/gcc/tree-predcom.c +++ b/gcc/tree-predcom.c @@ -2300,7 +2300,7 @@ try_combine_chains (vec *chains) { unsigned i, j; chain_p ch1, ch2, cch; - vec worklist = vec(); + vec worklist = vNULL; FOR_EACH_VEC_ELT (*chains, i, ch1) if (chain_can_be_combined_p (ch1)) @@ -2415,7 +2415,7 @@ tree_predictive_commoning_loop (struct loop *loop) vec datarefs; vec dependences; struct component *components; - vec chains = vec(); + vec chains = vNULL; unsigned unroll_factor; struct tree_niter_desc desc; bool unroll = false; diff --git a/gcc/tree-ssa-loop-im.c b/gcc/tree-ssa-loop-im.c index 7f4d045..d9265db 100644 --- a/gcc/tree-ssa-loop-im.c +++ b/gcc/tree-ssa-loop-im.c @@ -1806,7 +1806,7 @@ rewrite_mem_refs (struct loop *loop, mem_ref_p ref, tree tmp_var) { unsigned i; mem_ref_loc_p loc; - vec locs = vec(); + vec locs = vNULL; get_all_locs_in_loop (loop, ref, &locs); FOR_EACH_VEC_ELT (locs, i, loc) @@ -2078,7 +2078,7 @@ execute_sm_if_changed_flag_set (struct loop *loop, mem_ref_p ref) unsigned i; mem_ref_loc_p loc; tree flag; - vec locs = vec(); + vec locs = vNULL; char *str = get_lsm_tmp_name (ref->mem, ~0); lsm_tmp_name_add ("_flag"); @@ -2199,7 +2199,7 @@ hoist_memory_references (struct loop *loop, bitmap mem_refs, static bool ref_always_accessed_p (struct loop *loop, mem_ref_p ref, bool stored_p) { - vec locs = vec(); + vec locs = vNULL; unsigned i; mem_ref_loc_p loc; bool ret = false; diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 108c338..dbf643b 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -699,7 +699,7 @@ try_unroll_loop_completely (struct loop *loop, sbitmap wont_exit; edge e; unsigned i; - vec to_remove = vec(); + vec to_remove = vNULL; if (ul == UL_SINGLE_ITER) return false; diff --git a/gcc/tree-ssa-loop-manip.c b/gcc/tree-ssa-loop-manip.c index e3d2f9c..845c40e 100644 --- a/gcc/tree-ssa-loop-manip.c +++ b/gcc/tree-ssa-loop-manip.c @@ -1038,7 +1038,7 @@ tree_transform_and_unroll_loop (struct loop *loop, unsigned factor, unsigned new_est_niter, i, prob; unsigned irr = loop_preheader_edge (loop)->flags & EDGE_IRREDUCIBLE_LOOP; sbitmap wont_exit; - vec to_remove = vec(); + vec to_remove = vNULL; est_niter = expected_loop_iterations (loop); determine_exit_conditions (loop, desc, factor, diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index 69b94c7..d3007d7 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -2996,8 +2996,8 @@ discover_iteration_bound_by_body_walk (struct loop *loop) { pointer_map_t *bb_bounds; struct nb_iter_bound *elt; - vec bounds = vec(); - vec queues = vec(); + vec bounds = vNULL; + vec queues = vNULL; bb_queue queue = bb_queue(); ptrdiff_t queue_index; ptrdiff_t latch_index = 0; @@ -3166,7 +3166,7 @@ maybe_lower_iteration_bound (struct loop *loop) pointer_set_t *not_executed_last_iteration = NULL; struct nb_iter_bound *elt; bool found_exit = false; - vec queue = vec(); + vec queue = vNULL; bitmap visited; /* Collect all statements with interesting (i.e. lower than diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c index 975c0b6..33cf6ec 100644 --- a/gcc/tree-ssa-loop-prefetch.c +++ b/gcc/tree-ssa-loop-prefetch.c @@ -1541,11 +1541,11 @@ determine_loop_nest_reuse (struct loop *loop, struct mem_ref_group *refs, bool no_other_refs) { struct loop *nest, *aloop; - vec datarefs = vec(); - vec dependences = vec(); + vec datarefs = vNULL; + vec dependences = vNULL; struct mem_ref_group *gr; struct mem_ref *ref, *refb; - vec vloops = vec(); + vec vloops = vNULL; unsigned *loop_data_size; unsigned i, j, n; unsigned volume, dist, adist; diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c index cfaa420..7a41cfe 100644 --- a/gcc/tree-ssa-math-opts.c +++ b/gcc/tree-ssa-math-opts.c @@ -701,7 +701,7 @@ execute_cse_sincos_1 (tree name) tree fndecl, res, type; gimple def_stmt, use_stmt, stmt; int seen_cos = 0, seen_sin = 0, seen_cexpi = 0; - vec stmts = vec(); + vec stmts = vNULL; basic_block top_bb = NULL; int i; bool cfg_changed = false; diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index c81f65c..8a3789d 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -1657,9 +1657,9 @@ cond_if_else_store_replacement (basic_block then_bb, basic_block else_bb, then_ddrs.create (1); else_ddrs.create (1); if (!compute_all_dependences (then_datarefs, &then_ddrs, - vec(), false) + vNULL, false) || !compute_all_dependences (else_datarefs, &else_ddrs, - vec(), false)) + vNULL, false)) { free_dependence_relations (then_ddrs); free_dependence_relations (else_ddrs); diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 00b88bf..1b20a13 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -1534,8 +1534,7 @@ phi_translate_1 (pre_expr expr, bitmap_set_t set1, bitmap_set_t set2, vec operands = ref->operands; tree vuse = ref->vuse; tree newvuse = vuse; - vec newoperands - = vec(); + vec newoperands = vNULL; bool changed = false, same_valid = true; unsigned int i, j, n; vn_reference_op_t operand; @@ -3262,7 +3261,7 @@ do_regular_insertion (basic_block block, basic_block dom) bool new_stuff = false; vec exprs; pre_expr expr; - vec avail = vec(); + vec avail = vNULL; int i; exprs = sorted_array_from_bitmap_set (ANTIC_IN (block)); @@ -3432,7 +3431,7 @@ do_partial_partial_insertion (basic_block block, basic_block dom) bool new_stuff = false; vec exprs; pre_expr expr; - vec avail = vec(); + vec avail = vNULL; int i; exprs = sorted_array_from_bitmap_set (PA_IN (block)); @@ -3787,8 +3786,7 @@ compute_avail (void) { vn_reference_t ref; pre_expr result = NULL; - vec ops - = vec(); + vec ops = vNULL; /* We can value number only calls to real functions. */ if (gimple_call_internal_p (stmt)) diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c index 73dfa04..2203b66 100644 --- a/gcc/tree-ssa-propagate.c +++ b/gcc/tree-ssa-propagate.c @@ -732,7 +732,7 @@ update_call_from_tree (gimple_stmt_iterator *si_p, tree expr) tree fn = CALL_EXPR_FN (expr); unsigned i; unsigned nargs = call_expr_nargs (expr); - vec args = vec(); + vec args = vNULL; gimple new_stmt; if (nargs > 0) diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 471b8e6..7318ecf 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -2519,7 +2519,7 @@ maybe_optimize_range_tests (gimple stmt) basic_block bb; edge_iterator ei; edge e; - vec ops = vec(); + vec ops = vNULL; /* Consider only basic blocks that end with GIMPLE_COND or a cast statement satisfying final_range_test_p. All @@ -4067,7 +4067,7 @@ reassociate_bb (basic_block bb) if (associative_tree_code (rhs_code)) { - vec ops = vec(); + vec ops = vNULL; tree powi_result = NULL_TREE; /* There may be no immediate uses left by the time we @@ -4228,7 +4228,7 @@ init_reassoc (void) free (bbs); calculate_dominance_info (CDI_POST_DOMINATORS); - plus_negates = vec(); + plus_negates = vNULL; } /* Cleanup after the reassociation pass, and print stats if diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index ed89a5a..a7f0f9a 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1027,7 +1027,7 @@ copy_reference_ops_from_call (gimple call, static vec create_reference_ops_from_ref (tree ref) { - vec result = vec(); + vec result = vNULL; copy_reference_ops_from_ref (ref, &result); return result; @@ -1039,7 +1039,7 @@ create_reference_ops_from_ref (tree ref) static vec create_reference_ops_from_call (gimple call) { - vec result = vec(); + vec result = vNULL; copy_reference_ops_from_call (call, &result); return result; @@ -1316,7 +1316,7 @@ static vec valueize_shared_reference_ops_from_ref (tree ref, bool *valueized_anything) { if (!ref) - return vec(); + return vNULL; shared_lookup_references.truncate (0); copy_reference_ops_from_ref (ref, &shared_lookup_references); shared_lookup_references = valueize_refs_1 (shared_lookup_references, @@ -1332,7 +1332,7 @@ static vec valueize_shared_reference_ops_from_call (gimple call) { if (!call) - return vec(); + return vNULL; shared_lookup_references.truncate (0); copy_reference_ops_from_call (call, &shared_lookup_references); shared_lookup_references = valueize_refs (shared_lookup_references); @@ -1452,7 +1452,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_) tree base; HOST_WIDE_INT offset, maxsize; static vec - lhs_ops = vec(); + lhs_ops = vNULL; ao_ref lhs_ref; bool lhs_ref_ok = false; @@ -1658,7 +1658,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_) HOST_WIDE_INT offset2, size2, maxsize2; int i, j; vec - rhs = vec(); + rhs = vNULL; vn_reference_op_t vro; ao_ref r; @@ -1715,7 +1715,7 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_) vr->operands.safe_grow (i + 1 + rhs.length ()); if (old == shared_lookup_references && vr->operands != old) - shared_lookup_references = vec(); + shared_lookup_references = vNULL; } else vr->operands.truncate (i + 1 + rhs.length ()); @@ -2507,7 +2507,7 @@ vn_phi_insert (gimple phi, tree result) void **slot; vn_phi_t vp1 = (vn_phi_t) pool_alloc (current_info->phis_pool); unsigned i; - vec args = vec(); + vec args = vNULL; /* Canonicalize the SSA_NAME's to their value number. */ for (i = 0; i < gimple_phi_num_args (phi); i++) @@ -3672,7 +3672,7 @@ process_scc (vec scc) static bool extract_and_process_scc_for_name (tree name) { - vec scc = vec(); + vec scc = vNULL; tree x; /* Found an SCC, pop the components off the SCC stack and @@ -3721,8 +3721,8 @@ extract_and_process_scc_for_name (tree name) static bool DFS (tree name) { - vec itervec = vec(); - vec namevec = vec(); + vec itervec = vNULL; + vec namevec = vNULL; use_operand_p usep = NULL; gimple defstmt; tree use; diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c index 787115f..5ff4ce1 100644 --- a/gcc/tree-ssa-structalias.c +++ b/gcc/tree-ssa-structalias.c @@ -2441,7 +2441,7 @@ eliminate_indirect_cycles (unsigned int node) && !bitmap_empty_p (get_varinfo (node)->solution)) { unsigned int i; - vec queue = vec(); + vec queue = vNULL; int queuepos; unsigned int to = find (graph->indirect_cycles[node]); bitmap_iterator bi; @@ -3337,7 +3337,7 @@ get_constraint_for_1 (tree t, vec *results, bool address_p, { unsigned int i; tree val; - vec tmp = vec(); + vec tmp = vNULL; FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (t), i, val) { struct constraint_expr *rhsp; @@ -3437,8 +3437,8 @@ static void do_structure_copy (tree lhsop, tree rhsop) { struct constraint_expr *lhsp, *rhsp; - vec lhsc = vec(); - vec rhsc = vec(); + vec lhsc = vNULL; + vec rhsc = vNULL; unsigned j; get_constraint_for (lhsop, &lhsc); @@ -3524,7 +3524,7 @@ make_constraints_to (unsigned id, vec rhsc) static void make_constraint_to (unsigned id, tree op) { - vec rhsc = vec(); + vec rhsc = vNULL; get_constraint_for_rhs (op, &rhsc); make_constraints_to (id, rhsc); rhsc.release (); @@ -3798,7 +3798,7 @@ handle_rhs_call (gimple stmt, vec *results) && gimple_call_lhs (stmt) != NULL_TREE && TREE_ADDRESSABLE (TREE_TYPE (gimple_call_lhs (stmt)))) { - vec tmpc = vec(); + vec tmpc = vNULL; struct constraint_expr lhsc, *c; get_constraint_for_address_of (gimple_call_lhs (stmt), &tmpc); lhsc.var = escaped_id; @@ -3824,7 +3824,7 @@ static void handle_lhs_call (gimple stmt, tree lhs, int flags, vec rhsc, tree fndecl) { - vec lhsc = vec(); + vec lhsc = vNULL; get_constraint_for (lhs, &lhsc); /* If the store is to a global decl make sure to @@ -3909,7 +3909,7 @@ handle_const_call (gimple stmt, vec *results) for (k = 0; k < gimple_call_num_args (stmt); ++k) { tree arg = gimple_call_arg (stmt, k); - vec argc = vec(); + vec argc = vNULL; unsigned i; struct constraint_expr *argp; get_constraint_for_rhs (arg, &argc); @@ -4010,8 +4010,8 @@ static bool find_func_aliases_for_builtin_call (gimple t) { tree fndecl = gimple_call_fndecl (t); - vec lhsc = vec(); - vec rhsc = vec(); + vec lhsc = vNULL; + vec rhsc = vNULL; varinfo_t fi; if (fndecl != NULL_TREE @@ -4155,7 +4155,7 @@ find_func_aliases_for_builtin_call (gimple t) if (gimple_call_lhs (t)) { handle_lhs_call (t, gimple_call_lhs (t), gimple_call_flags (t), - vec(), fndecl); + vNULL, fndecl); get_constraint_for_ptr_offset (gimple_call_lhs (t), NULL_TREE, &lhsc); get_constraint_for_ptr_offset (gimple_call_arg (t, 0), @@ -4334,8 +4334,8 @@ static void find_func_aliases_for_call (gimple t) { tree fndecl = gimple_call_fndecl (t); - vec lhsc = vec(); - vec rhsc = vec(); + vec lhsc = vNULL; + vec rhsc = vNULL; varinfo_t fi; if (fndecl != NULL_TREE @@ -4347,7 +4347,7 @@ find_func_aliases_for_call (gimple t) if (!in_ipa_mode || (fndecl && !fi->is_fn_info)) { - vec rhsc = vec(); + vec rhsc = vNULL; int flags = gimple_call_flags (t); /* Const functions can return their arguments and addresses @@ -4404,7 +4404,7 @@ find_func_aliases_for_call (gimple t) && DECL_RESULT (fndecl) && DECL_BY_REFERENCE (DECL_RESULT (fndecl))) { - vec tem = vec(); + vec tem = vNULL; tem.safe_push (rhs); do_deref (&tem); rhs = tem[0]; @@ -4453,8 +4453,8 @@ static void find_func_aliases (gimple origt) { gimple t = origt; - vec lhsc = vec(); - vec rhsc = vec(); + vec lhsc = vNULL; + vec rhsc = vNULL; struct constraint_expr *c; varinfo_t fi; @@ -4536,7 +4536,7 @@ find_func_aliases (gimple origt) else if (code == COND_EXPR) { /* The result is a merge of both COND_EXPR arms. */ - vec tmp = vec(); + vec tmp = vNULL; struct constraint_expr *rhsp; unsigned i; get_constraint_for_rhs (gimple_assign_rhs2 (t), &rhsc); @@ -4552,7 +4552,7 @@ find_func_aliases (gimple origt) else { /* All other operations are merges. */ - vec tmp = vec(); + vec tmp = vNULL; struct constraint_expr *rhsp; unsigned i, j; get_constraint_for_rhs (gimple_assign_rhs1 (t), &rhsc); @@ -4625,7 +4625,7 @@ find_func_aliases (gimple origt) any global memory. */ if (op) { - vec lhsc = vec(); + vec lhsc = vNULL; struct constraint_expr rhsc, *lhsp; unsigned j; get_constraint_for (op, &lhsc); @@ -4669,7 +4669,7 @@ find_func_aliases (gimple origt) static void process_ipa_clobber (varinfo_t fi, tree ptr) { - vec ptrc = vec(); + vec ptrc = vNULL; struct constraint_expr *c, lhs; unsigned i; get_constraint_for_rhs (ptr, &ptrc); @@ -4687,8 +4687,8 @@ static void find_func_clobbers (gimple origt) { gimple t = origt; - vec lhsc = vec(); - vec rhsc = vec(); + vec lhsc = vNULL; + vec rhsc = vNULL; varinfo_t fi; /* Add constraints for clobbered/used in IPA mode. @@ -5458,7 +5458,7 @@ create_variable_info_for_1 (tree decl, const char *name) varinfo_t vi, newvi; tree decl_type = TREE_TYPE (decl); tree declsize = DECL_P (decl) ? DECL_SIZE (decl) : TYPE_SIZE (decl_type); - vec fieldstack = vec(); + vec fieldstack = vNULL; fieldoff_s *fo; unsigned int i; @@ -5609,7 +5609,7 @@ create_variable_info_for (tree decl, const char *name) if (DECL_INITIAL (decl) && vnode->analyzed) { - vec rhsc = vec(); + vec rhsc = vNULL; struct constraint_expr lhs, *rhsp; unsigned i; get_constraint_for_rhs (DECL_INITIAL (decl), &rhsc); diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 40c9d44..88c3f26 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -638,7 +638,7 @@ propagate_threaded_block_debug_into (basic_block dest, basic_block src) i++; } - vec fewvars = vec(); + vec fewvars = vNULL; pointer_set_t *vars = NULL; /* If we're already starting with 3/4 of alloc_count, go for a diff --git a/gcc/tree-ssa-uninit.c b/gcc/tree-ssa-uninit.c index c3b8df8..cdfcd5a 100644 --- a/gcc/tree-ssa-uninit.c +++ b/gcc/tree-ssa-uninit.c @@ -424,7 +424,7 @@ find_predicates (vec **preds, { size_t num_chains = 0, i; vec *dep_chains = 0; - vec cur_chain = vec(); + vec cur_chain = vNULL; bool has_valid_pred = false; basic_block cd_root = 0; @@ -525,8 +525,8 @@ find_def_preds (vec **preds, { size_t num_chains = 0, i, n; vec *dep_chains = 0; - vec cur_chain = vec(); - vec def_edges = vec(); + vec cur_chain = vNULL; + vec def_edges = vNULL; bool has_valid_pred = false; basic_block phi_bb, cd_root = 0; struct pointer_set_t *visited_phis; @@ -1633,7 +1633,7 @@ normalize_preds (vec *preds, size_t *n) { size_t i, j, ll; vec pred_chain; - vec x = vec(); + vec x = vNULL; use_pred_info_t xj = 0, nxj = 0; if (*n < 2) @@ -1954,7 +1954,7 @@ execute_late_warn_uninitialized (void) { basic_block bb; gimple_stmt_iterator gsi; - vec worklist = vec(); + vec worklist = vNULL; struct pointer_set_t *added_to_worklist; calculate_dominance_info (CDI_DOMINATORS); diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c index 8753f4f..121044e 100644 --- a/gcc/tree-stdarg.c +++ b/gcc/tree-stdarg.c @@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see static bool reachable_at_most_once (basic_block va_arg_bb, basic_block va_start_bb) { - vec stack = vec(); + vec stack = vNULL; edge e; edge_iterator ei; sbitmap visited; diff --git a/gcc/tree-switch-conversion.c b/gcc/tree-switch-conversion.c index 611b6b9..9eed5e0 100644 --- a/gcc/tree-switch-conversion.c +++ b/gcc/tree-switch-conversion.c @@ -301,7 +301,7 @@ emit_case_bit_tests (gimple swtch, tree index_expr, edge default_edge; bool update_dom = dom_info_available_p (CDI_DOMINATORS); - vec bbs_to_fix_dom = vec(); + vec bbs_to_fix_dom = vNULL; tree index_type = TREE_TYPE (index_expr); tree unsigned_index_type = unsigned_type_for (index_type); diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index 49dd3c0..44fe374 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -792,7 +792,7 @@ vect_analyze_data_ref_dependences (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, int *max_vf) { unsigned int i; - vec ddrs = vec(); + vec ddrs = vNULL; struct data_dependence_relation *ddr; if (dump_enabled_p ()) @@ -3007,7 +3007,7 @@ vect_analyze_data_refs (loop_vec_info loop_vinfo, } if (!compute_all_dependences (BB_VINFO_DATAREFS (bb_vinfo), &BB_VINFO_DDRS (bb_vinfo), - vec(), true)) + vNULL, true)) { if (dump_enabled_p ()) dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location, @@ -4745,7 +4745,7 @@ void vect_transform_grouped_load (gimple stmt, vec dr_chain, int size, gimple_stmt_iterator *gsi) { - vec result_chain = vec(); + vec result_chain = vNULL; /* DR_CHAIN contains input data-refs that are a part of the interleaving. RESULT_CHAIN is the output of vect_permute_load_chain, it contains permuted diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 6a86c91..04c3760 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -3698,13 +3698,13 @@ vect_create_epilog_for_reduction (vec vect_defs, gimple stmt, bool extract_scalar_result = false; gimple use_stmt, orig_stmt, reduction_phi = NULL; bool nested_in_vect_loop = false; - vec new_phis = vec(); - vec inner_phis = vec(); + vec new_phis = vNULL; + vec inner_phis = vNULL; enum vect_def_type dt = vect_unknown_def_type; int j, i; - vec scalar_results = vec(); + vec scalar_results = vNULL; unsigned int group_size = 1, k, ratio; - vec vec_initial_defs = vec(); + vec vec_initial_defs = vNULL; vec phis; bool slp_reduc = false; tree new_phi_result; @@ -4575,10 +4575,10 @@ vectorizable_reduction (gimple stmt, gimple_stmt_iterator *gsi, struct loop * def_stmt_loop, *outer_loop = NULL; tree def_arg; gimple def_arg_stmt; - vec vec_oprnds0 = vec(); - vec vec_oprnds1 = vec(); - vec vect_defs = vec(); - vec phis = vec(); + vec vec_oprnds0 = vNULL; + vec vec_oprnds1 = vNULL; + vec vect_defs = vNULL; + vec phis = vNULL; int vec_num; tree def0, def1, tem, op0, op1 = NULL_TREE; diff --git a/gcc/tree-vect-slp.c b/gcc/tree-vect-slp.c index e6f3da9..a4f537a 100644 --- a/gcc/tree-vect-slp.c +++ b/gcc/tree-vect-slp.c @@ -960,7 +960,7 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo, prologue_cost_vec, body_cost_vec)) { if (child) - oprnd_info->def_stmts = vec(); + oprnd_info->def_stmts = vNULL; vect_free_slp_tree (child); vect_free_oprnd_info (oprnds_info); return false; @@ -1058,7 +1058,7 @@ vect_supported_slp_permutation_p (slp_instance instance) slp_tree node = SLP_INSTANCE_LOADS (instance)[0]; gimple stmt = SLP_TREE_SCALAR_STMTS (node)[0]; gimple first_load = GROUP_FIRST_ELEMENT (vinfo_for_stmt (stmt)); - vec sorted_loads = vec(); + vec sorted_loads = vNULL; int index; slp_tree *tmp_loads = NULL; int group_size = SLP_INSTANCE_GROUP_SIZE (instance), i, j; @@ -1102,7 +1102,7 @@ vect_supported_slp_permutation_p (slp_instance instance) SLP_INSTANCE_LOADS (instance) = sorted_loads; free (tmp_loads); - if (!vect_transform_slp_perm_load (stmt, vec(), NULL, + if (!vect_transform_slp_perm_load (stmt, vNULL, NULL, SLP_INSTANCE_UNROLLING_FACTOR (instance), instance, true)) return false; @@ -1705,8 +1705,8 @@ vect_analyze_slp (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo) { unsigned int i; vec grouped_stores; - vec reductions = vec(); - vec reduc_chains = vec(); + vec reductions = vNULL; + vec reduc_chains = vNULL; gimple first_element; bool ok = false; diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index cfe1275..1e8d7ee 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -1722,7 +1722,7 @@ vectorizable_call (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, = {vect_unknown_def_type, vect_unknown_def_type, vect_unknown_def_type}; gimple new_stmt = NULL; int ncopies, j; - vec vargs = vec(); + vec vargs = vNULL; enum { NARROW, NONE, WIDEN } modifier; size_t i, nargs; tree lhs; @@ -2239,7 +2239,7 @@ vect_create_vectorized_promotion_stmts (vec *vec_oprnds0, int i; tree vop0, vop1, new_tmp1, new_tmp2; gimple new_stmt1, new_stmt2; - vec vec_tmp = vec(); + vec vec_tmp = vNULL; vec_tmp.create (vec_oprnds0->length () * 2); FOR_EACH_VEC_ELT (*vec_oprnds0, i, vop0) @@ -2305,13 +2305,13 @@ vectorizable_conversion (gimple stmt, gimple_stmt_iterator *gsi, int ncopies, i, j; tree lhs_type, rhs_type; enum { NARROW, NONE, WIDEN } modifier; - vec vec_oprnds0 = vec(); - vec vec_oprnds1 = vec(); + vec vec_oprnds0 = vNULL; + vec vec_oprnds1 = vNULL; tree vop0; bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); int multi_step_cvt = 0; - vec vec_dsts = vec(); - vec interm_types = vec(); + vec vec_dsts = vNULL; + vec interm_types = vNULL; tree last_oprnd, intermediate_type, cvt_type = NULL_TREE; int op_type; enum machine_mode rhs_mode; @@ -2878,7 +2878,7 @@ vectorizable_assignment (gimple stmt, gimple_stmt_iterator *gsi, unsigned int nunits = TYPE_VECTOR_SUBPARTS (vectype); int ncopies; int i, j; - vec vec_oprnds = vec(); + vec vec_oprnds = vNULL; tree vop; bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); gimple new_stmt = NULL; @@ -3087,8 +3087,8 @@ vectorizable_shift (gimple stmt, gimple_stmt_iterator *gsi, tree op1_vectype; int ncopies; int j, i; - vec vec_oprnds0 = vec(); - vec vec_oprnds1 = vec(); + vec vec_oprnds0 = vNULL; + vec vec_oprnds1 = vNULL; tree vop0, vop1; unsigned int k; bool scalar_shift_arg = true; @@ -3465,9 +3465,9 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi, tree vectype_out; int ncopies; int j, i; - vec vec_oprnds0 = vec(); - vec vec_oprnds1 = vec(); - vec vec_oprnds2 = vec(); + vec vec_oprnds0 = vNULL; + vec vec_oprnds1 = vNULL; + vec vec_oprnds2 = vNULL; tree vop0, vop1, vop2; bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); int vf; @@ -3820,11 +3820,11 @@ vectorizable_store (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, bool grouped_store = false; bool store_lanes_p = false; unsigned int group_size, i; - vec dr_chain = vec(); - vec oprnds = vec(); - vec result_chain = vec(); + vec dr_chain = vNULL; + vec oprnds = vNULL; + vec result_chain = vNULL; bool inv_p; - vec vec_oprnds = vec(); + vec vec_oprnds = vNULL; bool slp = (slp_node != NULL); unsigned int vec_num; bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); @@ -4337,7 +4337,7 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt, tree offset = NULL_TREE; tree realignment_token = NULL_TREE; gimple phi = NULL; - vec dr_chain = vec(); + vec dr_chain = vNULL; bool grouped_load = false; bool load_lanes_p = false; gimple first_stmt; @@ -5290,10 +5290,10 @@ vectorizable_condition (gimple stmt, gimple_stmt_iterator *gsi, stmt_vec_info prev_stmt_info = NULL; int i, j; bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_info); - vec vec_oprnds0 = vec(); - vec vec_oprnds1 = vec(); - vec vec_oprnds2 = vec(); - vec vec_oprnds3 = vec(); + vec vec_oprnds0 = vNULL; + vec vec_oprnds1 = vNULL; + vec vec_oprnds2 = vNULL; + vec vec_oprnds3 = vNULL; tree vec_cmp_type = vectype; if (slp_node || PURE_SLP_STMT (stmt_info)) diff --git a/gcc/value-prof.c b/gcc/value-prof.c index ac8a0b6..471b26c 100644 --- a/gcc/value-prof.c +++ b/gcc/value-prof.c @@ -1086,7 +1086,7 @@ gimple_mod_subtract_transform (gimple_stmt_iterator *si) } static vec cgraph_node_map - = vec(); + = vNULL; /* Initialize map from FUNCDEF_NO to CGRAPH_NODE. */ diff --git a/gcc/varasm.c b/gcc/varasm.c index 3aa58cf..4598cf2 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -5718,7 +5718,7 @@ tm_alias_pair_cmp (const void *x, const void *y) void finish_tm_clone_pairs (void) { - vec tm_alias_pairs = vec(); + vec tm_alias_pairs = vNULL; if (tm_clone_hash == NULL) return; diff --git a/gcc/vec.c b/gcc/vec.c index 28ca74f..f5f2d11 100644 --- a/gcc/vec.c +++ b/gcc/vec.c @@ -35,6 +35,17 @@ along with GCC; see the file COPYING3. If not see #include "diagnostic-core.h" #include "hashtab.h" +/* vNULL is an empty type with a template cast operation that returns + a zero-initialized vec instance. Use this when you want + to assign nil values to new vec instances or pass a nil vector as + a function call argument. + + We use this technique because vec must be PODs (they are + stored in unions and passed in vararg functions), this means that + they cannot have ctors/dtors. */ +vnull vNULL; + + /* Store information about each particular vector. */ struct vec_descriptor { diff --git a/gcc/vec.h b/gcc/vec.h index b8e6270..bfc1811 100644 --- a/gcc/vec.h +++ b/gcc/vec.h @@ -510,6 +510,17 @@ class GTY((user)) vec { }; +/* Type to provide NULL values for vec. This is used to + provide nil initializers for vec instances. Since vec must be + a POD, we cannot have proper ctor/dtor for it. To initialize + a vec instance, you can assign it the value vNULL. */ +struct vnull +{ + template + operator vec () { return vec(); } +}; +extern vnull vNULL; + /* Embeddable vector. These vectors are suitable to be embedded in other data structures so that they can be pre-allocated in a @@ -1432,7 +1443,7 @@ template inline vec vec::copy (ALONE_MEM_STAT_DECL) const { - vec new_vec = vec(); + vec new_vec = vNULL; if (length ()) new_vec.vec_ = vec_->copy (); return new_vec;