]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove unnecessary VEC function overloads.
authorDiego Novillo <dnovillo@google.com>
Tue, 11 Sep 2012 00:04:13 +0000 (20:04 -0400)
committerDiego Novillo <dnovillo@gcc.gnu.org>
Tue, 11 Sep 2012 00:04:13 +0000 (20:04 -0400)
Several VEC member functions that accept an element 'T' used to have
two overloads: one taking 'T', the second taking 'T *'.

This used to be needed because of the interface dichotomy between
vectors of objects and vectors of pointers.  In the past, vectors of
pointers would use pass-by-value semantics, but vectors of objects
would use pass-by-reference semantics.  This is no longer necessary,
but the distinction had remained.

The main side-effect of this change is some code reduction in code
that manipulates vectors of objects.  For instance,

-  struct iterator_use *iuse;
-
-  iuse = VEC_safe_push (iterator_use, heap, iterator_uses, NULL);
-  iuse->iterator = iterator;
-  iuse->ptr = ptr;
+  struct iterator_use iuse = {iterator, ptr};
+  VEC_safe_push (iterator_use, heap, iterator_uses, iuse);

Compile time performance was not affected.

Tested on x86_64 and ppc64.

Also built all-gcc on all targets using VEC routines: arm, bfin, c6x,
epiphany, ia64, mips, sh, spu, and vms.

2012-09-10  Diego Novillo  <dnovillo@google.com>

* vec.h (vec_t::quick_push): Remove overload that accepts 'T *'.
Update all users.
(vec_t::safe_push): Likewise.
(vec_t::quick_insert): Likewise.
(vec_t::lower_bound): Likewise.
(vec_t::safe_insert): Likewise.
(vec_t::replace): Change second argument to 'T &'.

From-SVN: r191165

71 files changed:
gcc/ChangeLog
gcc/ada/gcc-interface/decl.c
gcc/ada/gcc-interface/utils.c
gcc/alias.c
gcc/c-family/c-common.c
gcc/c-family/c-pragma.c
gcc/c/c-decl.c
gcc/c/c-tree.h
gcc/c/c-typeck.c
gcc/config/mips/mips.c
gcc/config/pa/pa.c
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.c
gcc/cp/class.c
gcc/cp/decl.c
gcc/cp/except.c
gcc/cp/init.c
gcc/cp/name-lookup.c
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/dwarf2cfi.c
gcc/dwarf2out.c
gcc/emit-rtl.c
gcc/except.c
gcc/fortran/trans-openmp.c
gcc/fwprop.c
gcc/gcc.c
gcc/gcse.c
gcc/genautomata.c
gcc/genextract.c
gcc/genopinit.c
gcc/gimple-low.c
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/gogo-tree.cc
gcc/graphite-sese-to-poly.c
gcc/ipa-inline-analysis.c
gcc/ipa-prop.c
gcc/ipa-split.c
gcc/java/class.c
gcc/java/expr.c
gcc/lto-cgraph.c
gcc/objc/objc-next-runtime-abi-02.c
gcc/opts-common.c
gcc/read-rtl.c
gcc/ree.c
gcc/reload1.c
gcc/sel-sched-ir.c
gcc/tree-call-cdce.c
gcc/tree-data-ref.c
gcc/tree-dfa.c
gcc/tree-diagnostic.c
gcc/tree-emutls.c
gcc/tree-sra.c
gcc/tree-ssa-dom.c
gcc/tree-ssa-pre.c
gcc/tree-ssa-reassoc.c
gcc/tree-ssa-sccvn.c
gcc/tree-ssa-structalias.c
gcc/tree-ssa.c
gcc/tree-switch-conversion.c
gcc/tree-vect-generic.c
gcc/tree-vect-loop-manip.c
gcc/tree-vect-slp.c
gcc/tree-vectorizer.h
gcc/tree-vrp.c
gcc/tree.c
gcc/tree.h
gcc/var-tracking.c
gcc/varasm.c
gcc/vec.h

index d75157f9f6c15eca87ca76c1cae1fa393a614927..0bfbcaab39ee72fe4f7bb99ab0bb0e0e5e3725f0 100644 (file)
@@ -1,3 +1,13 @@
+2012-09-10  Diego Novillo  <dnovillo@google.com>
+
+       * vec.h (vec_t::quick_push): Remove overload that accepts 'T *'.
+       Update all users.
+       (vec_t::safe_push): Likewise.
+       (vec_t::quick_insert): Likewise.
+       (vec_t::lower_bound): Likewise.
+       (vec_t::safe_insert): Likewise.
+       (vec_t::replace): Change second argument to 'T &'.
+
 2012-09-10  Maciej W. Rozycki  <macro@codesourcery.com>
 
        * config/rs6000/rs6000.md: Move a splitter next to its insn.
index cb0f074d7d2aed97602eb33fed5b10187b334b5e..9e14d8af1bf87be585c726cb2b7455f65311ec29 100644 (file)
@@ -7507,9 +7507,8 @@ build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition)
                                    (Node (gnat_value), gnat_subtype,
                                     get_entity_name (gnat_discrim),
                                     definition, true, false));
-       subst_pair *s = VEC_safe_push (subst_pair, heap, gnu_list, NULL);
-       s->discriminant = gnu_field;
-       s->replacement = replacement;
+       subst_pair s = {gnu_field, replacement};
+       VEC_safe_push (subst_pair, heap, gnu_list, s);
       }
 
   return gnu_list;
@@ -7541,14 +7540,10 @@ build_variant_list (tree qual_union_type, VEC(subst_pair,heap) *subst_list,
         still be accessed.  */
       if (!integer_zerop (qual))
        {
-         variant_desc *v;
          tree variant_type = TREE_TYPE (gnu_field), variant_subpart;
+         variant_desc v = {variant_type, gnu_field, qual, NULL_TREE};
 
-         v = VEC_safe_push (variant_desc, heap, gnu_list, NULL);
-         v->type = variant_type;
-         v->field = gnu_field;
-         v->qual = qual;
-         v->new_type = NULL_TREE;
+         VEC_safe_push (variant_desc, heap, gnu_list, v);
 
          /* Recurse on the variant subpart of the variant, if any.  */
          variant_subpart = get_variant_part (variant_type);
index 4cca41bbf3909dbf079f199427a454c7c6826efc..d9121c1931e004e5a94bd9895d6120d7631c1002 100644 (file)
@@ -4615,16 +4615,14 @@ convert (tree type, tree expr)
 
          FOR_EACH_CONSTRUCTOR_ELT(e, idx, index, value)
            {
-             constructor_elt *elt;
              /* We expect only simple constructors.  */
              if (!SAME_FIELD_P (index, efield))
                break;
              /* The field must be the same.  */
              if (!SAME_FIELD_P (efield, field))
                break;
-             elt = VEC_quick_push (constructor_elt, v, NULL);
-             elt->index = field;
-             elt->value = convert (TREE_TYPE (field), value);
+             constructor_elt elt = {field, convert (TREE_TYPE (field), value)};
+             VEC_quick_push (constructor_elt, v, elt);
 
              /* If packing has made this field a bitfield and the input
                 value couldn't be emitted statically any more, we need to
@@ -4690,9 +4688,8 @@ convert (tree type, tree expr)
          v = VEC_alloc (constructor_elt, gc, len);
          FOR_EACH_CONSTRUCTOR_VALUE (e, ix, value)
            {
-             constructor_elt *elt = VEC_quick_push (constructor_elt, v, NULL);
-             elt->index = NULL_TREE;
-             elt->value = value;
+             constructor_elt elt = {NULL_TREE, value};
+             VEC_quick_push (constructor_elt, v, elt);
            }
          expr = copy_node (expr);
          TREE_TYPE (expr) = type;
index 1df3529e94261629d799e337880a2adeba3a2ae8..0c6a7442b84735e214adff79574ca721133a4709 100644 (file)
@@ -855,8 +855,8 @@ new_alias_set (void)
   if (flag_strict_aliasing)
     {
       if (alias_sets == 0)
-       VEC_safe_push (alias_set_entry, gc, alias_sets, (alias_set_entry) 0);
-      VEC_safe_push (alias_set_entry, gc, alias_sets, (alias_set_entry) 0);
+       VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
+      VEC_safe_push (alias_set_entry, gc, alias_sets, 0);
       return VEC_length (alias_set_entry, alias_sets) - 1;
     }
   else
index 502613ae8df41de7c43647267358431142c0fd75..6de2f1c81fdd4f100b4e331d55b5f9216e5e834a 100644 (file)
@@ -8535,7 +8535,7 @@ parse_optimize_options (tree args, bool attr_p)
   /* Build up argv vector.  Just in case the string is stored away, use garbage
      collected strings.  */
   VEC_truncate (const_char_p, optimize_args, 0);
-  VEC_safe_push (const_char_p, gc, optimize_args, (const_char_p)NULL);
+  VEC_safe_push (const_char_p, gc, optimize_args, NULL);
 
   for (ap = args; ap != NULL_TREE; ap = TREE_CHAIN (ap))
     {
index 77ed0f0332594e0d449e9d7284e873f9d69cdfd9..70d8748ece93f0688279c8fbaf9b4c64c3017fdc 100644 (file)
@@ -372,10 +372,8 @@ handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
     }
   else
     {
-      pending_weak *pe;
-      pe = VEC_safe_push (pending_weak, gc, pending_weaks, NULL);
-      pe->name = name;
-      pe->value = value;
+      pending_weak pe = {name, value};
+      VEC_safe_push (pending_weak, gc, pending_weaks, pe);
     }
 }
 
@@ -499,9 +497,8 @@ add_to_renaming_pragma_list (tree oldname, tree newname)
        return;
       }
 
-  p = VEC_safe_push (pending_redefinition, gc, pending_redefine_extname, NULL);
-  p->oldname = oldname;
-  p->newname = newname;
+  pending_redefinition e = {oldname, newname};
+  VEC_safe_push (pending_redefinition, gc, pending_redefine_extname, e);
 }
 
 /* The current prefix set by #pragma extern_prefix.  */
@@ -1236,14 +1233,14 @@ c_register_pragma_1 (const char *space, const char *name,
 
       ns_name.space = space;
       ns_name.name = name;
-      VEC_safe_push (pragma_ns_name, heap, registered_pp_pragmas, &ns_name);
+      VEC_safe_push (pragma_ns_name, heap, registered_pp_pragmas, ns_name);
       id = VEC_length (pragma_ns_name, registered_pp_pragmas);
       id += PRAGMA_FIRST_EXTERNAL - 1;
     }
   else
     {
       VEC_safe_push (internal_pragma_handler, heap, registered_pragmas,
-                     &ihandler);
+                     ihandler);
       id = VEC_length (internal_pragma_handler, registered_pragmas);
       id += PRAGMA_FIRST_EXTERNAL - 1;
 
index e5d17b7ec99e136af83c23c62bb8959ede933a10..d4c7b1f872e181d52cdc11b6774f8f3e64a1e111 100644 (file)
@@ -6437,7 +6437,7 @@ get_parm_info (bool ellipsis, tree expr)
     {
       tree decl = b->decl;
       tree type = TREE_TYPE (decl);
-      c_arg_tag *tag;
+      c_arg_tag tag;
       const char *keyword;
 
       switch (TREE_CODE (decl))
@@ -6511,9 +6511,9 @@ get_parm_info (bool ellipsis, tree expr)
                }
            }
 
-         tag = VEC_safe_push (c_arg_tag, gc, tags, NULL);
-         tag->id = b->id;
-         tag->type = decl;
+         tag.id = b->id;
+         tag.type = decl;
+         VEC_safe_push (c_arg_tag, gc, tags, tag);
          break;
 
        case CONST_DECL:
index c07d994975d6604b9d68d44816fde68ae9028b69..17fc719b49d2ad98b1d1a899ff57fb816f46be52 100644 (file)
@@ -142,8 +142,8 @@ DEF_VEC_ALLOC_O (c_expr_t, heap);
 /* Append a new c_expr_t element to V.  */
 #define C_EXPR_APPEND(V, ELEM) \
   do { \
-    c_expr_t *__elem_p = VEC_safe_push (c_expr_t, gc, V, NULL); \
-    *__elem_p = (ELEM); \
+    c_expr_t __elem = (ELEM); \
+    VEC_safe_push (c_expr_t, gc, V, __elem); \
   } while (0)
 
 /* A kind of type specifier.  Note that this information is currently
index 99920ef288b140eabd1d08ceb3afdc3126bc891e..b5fb9c984eec4fa284428c482d2024a5373310e0 100644 (file)
@@ -7709,7 +7709,6 @@ output_init_element (tree value, tree origtype, bool strict_string, tree type,
                     struct obstack * braced_init_obstack)
 {
   tree semantic_type = NULL_TREE;
-  constructor_elt *celt;
   bool maybe_const = true;
   bool npc;
 
@@ -7876,9 +7875,8 @@ output_init_element (tree value, tree origtype, bool strict_string, tree type,
   /* Otherwise, output this element either to
      constructor_elements or to the assembler file.  */
 
-  celt = VEC_safe_push (constructor_elt, gc, constructor_elements, NULL);
-  celt->index = field;
-  celt->value = value;
+  constructor_elt celt = {field, value};
+  VEC_safe_push (constructor_elt, gc, constructor_elements, celt);
 
   /* Advance the variable that indicates sequential elements output.  */
   if (TREE_CODE (constructor_type) == ARRAY_TYPE)
index 09322f15926cc603f3bf1d33e7e262efbb53dd09..7f9df4c161b1946da29c9266be3e9dfde04b8c0f 100644 (file)
@@ -3989,8 +3989,8 @@ mips_multi_start (void)
 static struct mips_multi_member *
 mips_multi_add (void)
 {
-  return VEC_safe_push (mips_multi_member, heap, mips_multi_members,
-                       (struct mips_multi_member *) 0);
+  mips_multi_member empty;
+  return VEC_safe_push (mips_multi_member, heap, mips_multi_members, empty);
 }
 
 /* Add a normal insn with the given asm format to the current multi-insn
index cba8e7817222417093304000afaa02c51f6ecfb7..6c8f8278d58c90b94de9c3d6c00069a8747e8dd9 100644 (file)
@@ -9948,11 +9948,9 @@ static GTY(()) VEC(extern_symbol,gc) *extern_symbols;
 void
 pa_hpux_asm_output_external (FILE *file, tree decl, const char *name)
 {
-  extern_symbol * p = VEC_safe_push (extern_symbol, gc, extern_symbols, NULL);
-
   gcc_assert (file == asm_out_file);
-  p->decl = decl;
-  p->name = name;
+  extern_symbol p = {decl, name};
+  VEC_safe_push (extern_symbol, gc, extern_symbols, p);
 }
 
 /* Output text required at the end of an assembler file.
index a2ef08e17cae4c2167fcd82d56aa765a28abf48c..58101ab4bfff45e16f7d347ad23b31229725d8f8 100644 (file)
@@ -3582,11 +3582,8 @@ altivec_resolve_overloaded_builtin (location_t loc, tree fndecl,
       vec = VEC_alloc (constructor_elt, gc, size);
       for(i = 0; i < size; i++)
        {
-         constructor_elt *elt;
-
-         elt = VEC_quick_push (constructor_elt, vec, NULL);
-         elt->index = NULL_TREE;
-         elt->value = arg;
+         constructor_elt elt = {NULL_TREE, arg};
+         VEC_quick_push (constructor_elt, vec, elt);
        }
        return build_constructor (type, vec);
     }
index c125019e8213d95b1d18d13db2594963c9c4a509..a5a3848e58565c0dac6c42bdbb0baed095c478e9 100644 (file)
@@ -24901,11 +24901,8 @@ static void
 add_compiler_branch_island (tree label_name, tree function_name,
                            int line_number)
 {
-  branch_island *bi = VEC_safe_push (branch_island, gc, branch_islands, NULL);
-
-  bi->function_name = function_name;
-  bi->label_name = label_name;
-  bi->line_number = line_number;
+  branch_island bi = {function_name, label_name, line_number};
+  VEC_safe_push (branch_island, gc, branch_islands, bi);
 }
 
 /* Generate far-jump branch islands for everything recorded in
index 13d9c768509ba1519f7280adb9bc53d594740d50..7abcc7e0da857703dc2ac4db1fca85059a0b25c3 100644 (file)
@@ -8835,11 +8835,9 @@ add_vcall_offset (tree orig_fn, tree binfo, vtbl_init_data *vid)
      offset.  */
   if (vid->binfo == TYPE_BINFO (vid->derived))
     {
-      tree_pair_p elt = VEC_safe_push (tree_pair_s, gc,
-                                      CLASSTYPE_VCALL_INDICES (vid->derived),
-                                      NULL);
-      elt->purpose = orig_fn;
-      elt->value = vid->index;
+      tree_pair_s elt = {orig_fn, vid->index};
+      VEC_safe_push (tree_pair_s, gc, CLASSTYPE_VCALL_INDICES (vid->derived),
+                    elt);
     }
 
   /* The next vcall offset will be found at a more negative
index e34092d58e678e0a1a6181c55e59210aedafbd42..1f33bf9116f5dbf9e31467f5ee292ad40b8eac11 100644 (file)
@@ -2639,16 +2639,16 @@ tree
 declare_local_label (tree id)
 {
   tree decl;
-  cp_label_binding *bind;
+  cp_label_binding bind;
 
   /* Add a new entry to the SHADOWED_LABELS list so that when we leave
      this scope we can restore the old value of IDENTIFIER_TYPE_VALUE.  */
-  bind = VEC_safe_push (cp_label_binding, gc,
-                       current_binding_level->shadowed_labels, NULL);
-  bind->prev_value = IDENTIFIER_LABEL_VALUE (id);
+  bind.prev_value = IDENTIFIER_LABEL_VALUE (id);
 
   decl = make_label_decl (id, /*local_p=*/1);
-  bind->label = decl;
+  bind.label = decl;
+  VEC_safe_push (cp_label_binding, gc, current_binding_level->shadowed_labels,
+                bind);
 
   return decl;
 }
@@ -13782,10 +13782,8 @@ maybe_register_incomplete_var (tree var)
          || (TYPE_LANG_SPECIFIC (inner_type)
              && TYPE_BEING_DEFINED (inner_type)))
        {
-         incomplete_var *iv
-           = VEC_safe_push (incomplete_var, gc, incomplete_vars, NULL);
-         iv->decl = var;
-         iv->incomplete_type = inner_type;
+         incomplete_var iv = {var, inner_type};
+         VEC_safe_push (incomplete_var, gc, incomplete_vars, iv);
        }
     }
 }
index ff967de37f72bcf8490020564e0ec1c0c58daa0d..da3441856e28bf9e2e387c9087052d7cea704539 100644 (file)
@@ -1249,11 +1249,8 @@ expr_noexcept_p (tree expr, tsubst_flags_t complain)
          if (!DECL_INITIAL (fn))
            {
              /* Not defined yet; check again at EOF.  */
-             pending_noexcept *p
-               = VEC_safe_push (pending_noexcept, gc,
-                                pending_noexcept_checks, NULL);
-             p->fn = fn;
-             p->loc = input_location;
+             pending_noexcept p = {fn, input_location};
+             VEC_safe_push (pending_noexcept, gc, pending_noexcept_checks, p);
            }
          else
            maybe_noexcept_warning (fn);
index 561477ace5787f8182a93af7d944079f435e246a..23d86d5b1476b502d3b1fdd2aeaed7776de706e4 100644 (file)
@@ -253,21 +253,21 @@ build_zero_init_1 (tree type, tree nelts, bool static_storage_p,
         have an upper bound of -1.  */
       if (!tree_int_cst_equal (max_index, integer_minus_one_node))
        {
-         constructor_elt *ce;
+         constructor_elt ce;
 
          v = VEC_alloc (constructor_elt, gc, 1);
-         ce = VEC_quick_push (constructor_elt, v, NULL);
 
          /* If this is a one element array, we just use a regular init.  */
          if (tree_int_cst_equal (size_zero_node, max_index))
-           ce->index = size_zero_node;
+           ce.index = size_zero_node;
          else
-           ce->index = build2 (RANGE_EXPR, sizetype, size_zero_node,
+           ce.index = build2 (RANGE_EXPR, sizetype, size_zero_node,
                                max_index);
 
-         ce->value = build_zero_init_1 (TREE_TYPE (type),
+         ce.value = build_zero_init_1 (TREE_TYPE (type),
                                         /*nelts=*/NULL_TREE,
                                         static_storage_p, NULL_TREE);
+         VEC_quick_push (constructor_elt, v, ce);
        }
 
       /* Build a constructor to contain the initializations.  */
@@ -448,28 +448,27 @@ build_value_init_noctor (tree type, tsubst_flags_t complain)
         have an upper bound of -1.  */
       if (!tree_int_cst_equal (max_index, integer_minus_one_node))
        {
-         constructor_elt *ce;
+         constructor_elt ce;
 
          v = VEC_alloc (constructor_elt, gc, 1);
-         ce = VEC_quick_push (constructor_elt, v, NULL);
 
          /* If this is a one element array, we just use a regular init.  */
          if (tree_int_cst_equal (size_zero_node, max_index))
-           ce->index = size_zero_node;
+           ce.index = size_zero_node;
          else
-           ce->index = build2 (RANGE_EXPR, sizetype, size_zero_node,
-                               max_index);
+           ce.index = build2 (RANGE_EXPR, sizetype, size_zero_node, max_index);
 
-         ce->value = build_value_init (TREE_TYPE (type), complain);
+         ce.value = build_value_init (TREE_TYPE (type), complain);
+         VEC_quick_push (constructor_elt, v, ce);
 
-         if (ce->value == error_mark_node)
+         if (ce.value == error_mark_node)
            return error_mark_node;
 
          /* We shouldn't have gotten here for anything that would need
             non-trivial initialization, and gimplify_init_ctor_preeval
             would need to be fixed to allow it.  */
-         gcc_assert (TREE_CODE (ce->value) != TARGET_EXPR
-                     && TREE_CODE (ce->value) != AGGR_INIT_EXPR);
+         gcc_assert (TREE_CODE (ce.value) != TARGET_EXPR
+                     && TREE_CODE (ce.value) != AGGR_INIT_EXPR);
        }
 
       /* Build a constructor to contain the initializations.  */
index 9392c01dc94b368f634e6d73ed92bc5bcf51535a..e4e982764c389029eb7b26e068158de4a9a6cd04 100644 (file)
@@ -318,13 +318,9 @@ cxx_binding_free (cxx_binding *binding)
 static cxx_binding *
 new_class_binding (tree name, tree value, tree type, cp_binding_level *scope)
 {
-  cp_class_binding *cb;
-  cxx_binding *binding;
-
-    cb = VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, NULL);
-
-  cb->identifier = name;
-  cb->base = binding = cxx_binding_make (value, type);
+  cp_class_binding cb = {cxx_binding_make (value, type), name};
+  cxx_binding *binding = cb.base;
+  VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, cb);
   binding->scope = scope;
   return binding;
 }
@@ -5884,16 +5880,16 @@ store_binding_p (tree id)
 static void
 store_binding (tree id, VEC(cxx_saved_binding,gc) **old_bindings)
 {
-  cxx_saved_binding *saved;
+  cxx_saved_binding saved;
 
   gcc_checking_assert (store_binding_p (id));
 
   IDENTIFIER_MARKED (id) = 1;
 
-  saved = VEC_quick_push (cxx_saved_binding, *old_bindings, NULL);
-  saved->identifier = id;
-  saved->binding = IDENTIFIER_BINDING (id);
-  saved->real_type_value = REAL_IDENTIFIER_TYPE_VALUE (id);
+  saved.identifier = id;
+  saved.binding = IDENTIFIER_BINDING (id);
+  saved.real_type_value = REAL_IDENTIFIER_TYPE_VALUE (id);
+  VEC_quick_push (cxx_saved_binding, *old_bindings, saved);
   IDENTIFIER_BINDING (id) = NULL;
 }
 
index 327ad0b2c7db1310f285897759cf7ec594de1520..b641e08353372b761ab9f8266c21d4904331cd4d 100644 (file)
@@ -590,13 +590,13 @@ cp_lexer_new_main (void)
   lexer = cp_lexer_alloc ();
 
   /* Put the first token in the buffer.  */
-  VEC_quick_push (cp_token, lexer->buffer, &token);
+  VEC_quick_push (cp_token, lexer->buffer, token);
 
   /* Get the remaining tokens from the preprocessor.  */
   while (token.type != CPP_EOF)
     {
       cp_lexer_get_preprocessor_token (lexer, &token);
-      VEC_safe_push (cp_token, gc, lexer->buffer, &token);
+      VEC_safe_push (cp_token, gc, lexer->buffer, token);
     }
 
   lexer->last_token = VEC_address (cp_token, lexer->buffer)
@@ -1731,11 +1731,8 @@ cp_parser_context_new (cp_parser_context* next)
 static void
 push_unparsed_function_queues (cp_parser *parser)
 {
-  VEC_safe_push (cp_unparsed_functions_entry, gc,
-                parser->unparsed_queues, NULL);
-  unparsed_funs_with_default_args = NULL;
-  unparsed_funs_with_definitions = make_tree_vector ();
-  unparsed_nsdmis = NULL;
+  cp_unparsed_functions_entry e = {NULL, make_tree_vector (), NULL};
+  VEC_safe_push (cp_unparsed_functions_entry, gc, parser->unparsed_queues, e);
 }
 
 static void
@@ -8028,7 +8025,7 @@ start_lambda_scope (tree decl)
     decl = current_function_decl;
   ti.t = lambda_scope;
   ti.i = lambda_count;
-  VEC_safe_push (tree_int, gc, lambda_scope_stack, &ti);
+  VEC_safe_push (tree_int, gc, lambda_scope_stack, ti);
   if (lambda_scope != decl)
     {
       /* Don't reset the count if we're still in the same function.  */
@@ -21758,11 +21755,9 @@ cp_parser_save_default_args (cp_parser* parser, tree decl)
        probe = TREE_CHAIN (probe))
     if (TREE_PURPOSE (probe))
       {
-       cp_default_arg_entry *entry
-         = VEC_safe_push (cp_default_arg_entry, gc,
-                          unparsed_funs_with_default_args, NULL);
-       entry->class_type = current_class_type;
-       entry->decl = decl;
+       cp_default_arg_entry entry = {current_class_type, decl};
+       VEC_safe_push (cp_default_arg_entry, gc,
+                      unparsed_funs_with_default_args, entry);
        break;
       }
 }
index a87552827a9268a887117ab947ca5da24fdddbbc..768f141accf05605d2a6d969a787d66fc9b8f70d 100644 (file)
@@ -20390,7 +20390,7 @@ append_type_to_template_for_access_check_1 (tree t,
 
   VEC_safe_push (qualified_typedef_usage_t, gc,
                 TI_TYPEDEFS_NEEDING_ACCESS_CHECKING (ti),
-                &typedef_usage);
+                typedef_usage);
 }
 
 /* Append TYPE_DECL to the template TEMPL.
index 642e15d553da5b53acb60cc0d0234315fc6b9884..a6cdfb5688900fd05ec268574671dd800a05c1a4 100644 (file)
@@ -145,11 +145,8 @@ push_deferring_access_checks (deferring_kind deferring)
     deferred_access_no_check++;
   else
     {
-      deferred_access *ptr;
-
-      ptr = VEC_safe_push (deferred_access, gc, deferred_access_stack, NULL);
-      ptr->deferred_access_checks = NULL;
-      ptr->deferring_access_checks_kind = deferring;
+      deferred_access e = {NULL, deferring};
+      VEC_safe_push (deferred_access, gc, deferred_access_stack, e);
     }
 }
 
@@ -243,7 +240,7 @@ pop_to_parent_deferring_access_checks (void)
                }
              /* Insert into parent's checks.  */
              VEC_safe_push (deferred_access_check, gc,
-                            ptr->deferred_access_checks, chk);
+                            ptr->deferred_access_checks, *chk);
            found:;
            }
        }
@@ -311,7 +308,6 @@ perform_or_defer_access_check (tree binfo, tree decl, tree diag_decl,
   int i;
   deferred_access *ptr;
   deferred_access_check *chk;
-  deferred_access_check *new_access;
 
 
   /* Exit if we are in a context that no access checking is performed.
@@ -341,13 +337,9 @@ perform_or_defer_access_check (tree binfo, tree decl, tree diag_decl,
        }
     }
   /* If not, record the check.  */
-  new_access =
-    VEC_safe_push (deferred_access_check, gc,
-                  ptr->deferred_access_checks, 0);
-  new_access->binfo = binfo;
-  new_access->decl = decl;
-  new_access->diag_decl = diag_decl;
-  new_access->loc = input_location;
+  deferred_access_check new_access = {binfo, decl, diag_decl, input_location};
+  VEC_safe_push (deferred_access_check, gc, ptr->deferred_access_checks,
+                new_access);
 
   return true;
 }
index 17027857babd9d859321c68b6ab4fcc58e5fef49..355c74698aa39f76a23f43482c109365655209aa 100644 (file)
@@ -941,10 +941,8 @@ record_reg_saved_in_reg (rtx dest, rtx src)
   if (dest == NULL)
     return;
 
-  elt = VEC_safe_push (reg_saved_in_data, heap,
-                      cur_trace->regs_saved_in_regs, NULL);
-  elt->orig_reg = src;
-  elt->saved_in_reg = dest;
+  reg_saved_in_data e = {src, dest};
+  VEC_safe_push (reg_saved_in_data, heap, cur_trace->regs_saved_in_regs, e);
 }
 
 /* Add an entry to QUEUED_REG_SAVES saying that REG is now saved at
@@ -954,20 +952,19 @@ static void
 queue_reg_save (rtx reg, rtx sreg, HOST_WIDE_INT offset)
 {
   queued_reg_save *q;
+  queued_reg_save e = {reg, sreg, offset};
   size_t i;
 
   /* Duplicates waste space, but it's also necessary to remove them
      for correctness, since the queue gets output in reverse order.  */
   FOR_EACH_VEC_ELT (queued_reg_save, queued_reg_saves, i, q)
     if (compare_reg_or_pc (q->reg, reg))
-      goto found;
-
-  q = VEC_safe_push (queued_reg_save, heap, queued_reg_saves, NULL);
+      {
+       *q = e;
+       return;
+      }
 
- found:
-  q->reg = reg;
-  q->saved_reg = sreg;
-  q->cfa_offset = offset;
+  VEC_safe_push (queued_reg_save, heap, queued_reg_saves, e);
 }
 
 /* Output all the entries in QUEUED_REG_SAVES.  */
@@ -2713,23 +2710,23 @@ static void
 create_pseudo_cfg (void)
 {
   bool saw_barrier, switch_sections;
-  dw_trace_info *ti;
+  dw_trace_info ti;
   rtx insn;
   unsigned i;
 
   /* The first trace begins at the start of the function,
      and begins with the CIE row state.  */
   trace_info = VEC_alloc (dw_trace_info, heap, 16);
-  ti = VEC_quick_push (dw_trace_info, trace_info, NULL);
+  memset (&ti, 0, sizeof (ti));
+  ti.head = get_insns ();
+  ti.beg_row = cie_cfi_row;
+  ti.cfa_store = cie_cfi_row->cfa;
+  ti.cfa_temp.reg = INVALID_REGNUM;
+  VEC_quick_push (dw_trace_info, trace_info, ti);
 
-  memset (ti, 0, sizeof (*ti));
-  ti->head = get_insns ();
-  ti->beg_row = cie_cfi_row;
-  ti->cfa_store = cie_cfi_row->cfa;
-  ti->cfa_temp.reg = INVALID_REGNUM;
   if (cie_return_save)
     VEC_safe_push (reg_saved_in_data, heap,
-                  ti->regs_saved_in_regs, cie_return_save);
+                  ti.regs_saved_in_regs, *cie_return_save);
 
   /* Walk all the insns, collecting start of trace locations.  */
   saw_barrier = false;
@@ -2751,11 +2748,11 @@ create_pseudo_cfg (void)
       else if (save_point_p (insn)
               && (LABEL_P (insn) || !saw_barrier))
        {
-         ti = VEC_safe_push (dw_trace_info, heap, trace_info, NULL);
-         memset (ti, 0, sizeof (*ti));
-         ti->head = insn;
-         ti->switch_sections = switch_sections;
-         ti->id = VEC_length (dw_trace_info, trace_info) - 1;
+         memset (&ti, 0, sizeof (ti));
+         ti.head = insn;
+         ti.switch_sections = switch_sections;
+         ti.id = VEC_length (dw_trace_info, trace_info) - 1;
+         VEC_safe_push (dw_trace_info, heap, trace_info, ti);
 
          saw_barrier = false;
          switch_sections = false;
@@ -2766,19 +2763,20 @@ create_pseudo_cfg (void)
      avoiding stale pointer problems due to reallocation.  */
   trace_index = htab_create (VEC_length (dw_trace_info, trace_info),
                             dw_trace_info_hash, dw_trace_info_eq, NULL);
-  FOR_EACH_VEC_ELT (dw_trace_info, trace_info, i, ti)
+  dw_trace_info *tp;
+  FOR_EACH_VEC_ELT (dw_trace_info, trace_info, i, tp)
     {
       void **slot;
 
       if (dump_file)
        fprintf (dump_file, "Creating trace %u : start at %s %d%s\n", i,
-                rtx_name[(int) GET_CODE (ti->head)], INSN_UID (ti->head),
-                ti->switch_sections ? " (section switch)" : "");
+                rtx_name[(int) GET_CODE (tp->head)], INSN_UID (tp->head),
+                tp->switch_sections ? " (section switch)" : "");
 
-      slot = htab_find_slot_with_hash (trace_index, ti,
-                                      INSN_UID (ti->head), INSERT);
+      slot = htab_find_slot_with_hash (trace_index, tp,
+                                      INSN_UID (tp->head), INSERT);
       gcc_assert (*slot == NULL);
-      *slot = (void *) ti;
+      *slot = (void *) tp;
     }
 }
 
index 9adb07106ba23f307bd7a94b2a47de3340ca9178..61ea948cbb78cbba6fb84352c2f43523ba421a19 100644 (file)
@@ -3484,7 +3484,7 @@ add_dwarf_attr (dw_die_ref die, dw_attr_ref attr)
 
   if (die->die_attr == NULL)
     die->die_attr = VEC_alloc (dw_attr_node, gc, 1);
-  VEC_safe_push (dw_attr_node, gc, die->die_attr, attr);
+  VEC_safe_push (dw_attr_node, gc, die->die_attr, *attr);
 }
 
 static inline enum dw_val_class
@@ -8218,7 +8218,7 @@ add_pubname_string (const char *str, dw_die_ref die)
 
   e.die = die;
   e.name = xstrdup (str);
-  VEC_safe_push (pubname_entry, gc, pubname_table, &e);
+  VEC_safe_push (pubname_entry, gc, pubname_table, e);
 }
 
 static void
@@ -8252,7 +8252,7 @@ add_enumerator_pubname (const char *scope_name, dw_die_ref die)
   gcc_assert (scope_name);
   e.name = concat (scope_name, get_AT_string (die, DW_AT_name), NULL);
   e.die = die;
-  VEC_safe_push (pubname_entry, gc, pubname_table, &e);
+  VEC_safe_push (pubname_entry, gc, pubname_table, e);
 }
 
 /* Add a new entry to .debug_pubtypes if appropriate.  */
@@ -8295,7 +8295,7 @@ add_pubtype (tree decl, dw_die_ref die)
         {
           e.die = die;
           e.name = concat (scope_name, name, NULL);
-          VEC_safe_push (pubname_entry, gc, pubtype_table, &e);
+          VEC_safe_push (pubname_entry, gc, pubtype_table, e);
         }
 
       /* Although it might be more consistent to add the pubinfo for the
@@ -14671,7 +14671,7 @@ defer_location (tree variable, dw_die_ref die)
   deferred_locations entry;
   entry.variable = variable;
   entry.die = die;
-  VEC_safe_push (deferred_locations, gc, deferred_locations_list, &entry);
+  VEC_safe_push (deferred_locations, gc, deferred_locations_list, entry);
 }
 
 /* Helper function for tree_add_const_value_attribute.  Natively encode
@@ -19870,7 +19870,7 @@ append_entry_to_tmpl_value_parm_die_table (dw_die_ref die, tree arg)
   entry.arg = arg;
   VEC_safe_push (die_arg_entry, gc,
                 tmpl_value_parm_die_table,
-                &entry);
+                entry);
 }
 
 /* Return TRUE if T is an instance of generic type, FALSE
@@ -20256,7 +20256,7 @@ push_dw_line_info_entry (dw_line_info_table *table,
   dw_line_info_entry e;
   e.opcode = opcode;
   e.val = val;
-  VEC_safe_push (dw_line_info_entry, gc, table->entries, &e);
+  VEC_safe_push (dw_line_info_entry, gc, table->entries, e);
 }
 
 /* Output a label to mark the beginning of a source code line entry
@@ -20376,7 +20376,7 @@ dwarf2out_start_source_file (unsigned int lineno, const char *filename)
       e.code = DW_MACINFO_start_file;
       e.lineno = lineno;
       e.info = ggc_strdup (filename);
-      VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+      VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
     }
 }
 
@@ -20395,7 +20395,7 @@ dwarf2out_end_source_file (unsigned int lineno ATTRIBUTE_UNUSED)
       e.code = DW_MACINFO_end_file;
       e.lineno = lineno;
       e.info = NULL;
-      VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+      VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
     }
 }
 
@@ -20417,12 +20417,12 @@ dwarf2out_define (unsigned int lineno ATTRIBUTE_UNUSED,
          e.code = 0;
          e.lineno = 0;
          e.info = NULL;
-         VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+         VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
        }
       e.code = DW_MACINFO_define;
       e.lineno = lineno;
       e.info = ggc_strdup (buffer);
-      VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+      VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
     }
 }
 
@@ -20444,12 +20444,12 @@ dwarf2out_undef (unsigned int lineno ATTRIBUTE_UNUSED,
          e.code = 0;
          e.lineno = 0;
          e.info = NULL;
-         VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+         VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
        }
       e.code = DW_MACINFO_undef;
       e.lineno = lineno;
       e.info = ggc_strdup (buffer);
-      VEC_safe_push (macinfo_entry, gc, macinfo_table, &e);
+      VEC_safe_push (macinfo_entry, gc, macinfo_table, e);
     }
 }
 
@@ -20725,7 +20725,7 @@ output_macinfo (void)
       switch (ref->code)
        {
        case DW_MACINFO_start_file:
-         VEC_safe_push (macinfo_entry, gc, files, ref);
+         VEC_safe_push (macinfo_entry, gc, files, *ref);
          break;
        case DW_MACINFO_end_file:
          if (!VEC_empty (macinfo_entry, files))
@@ -21364,7 +21364,7 @@ move_linkage_attr (dw_die_ref die)
   if (ix != VEC_length (dw_attr_node, die->die_attr) - 1)
     {
       VEC_pop (dw_attr_node, die->die_attr);
-      VEC_quick_insert (dw_attr_node, die->die_attr, ix, &linkage);
+      VEC_quick_insert (dw_attr_node, die->die_attr, ix, linkage);
     }
 }
 
index 34d85de495fe52eff2bdafa0d4193858977af115..074e89ea534a4897cb6ed3a4c26a37e8c4d7b6a2 100644 (file)
@@ -6004,7 +6004,7 @@ curr_insn_locator (void)
     {
       curr_rtl_loc++;
       VEC_safe_push (int, heap, locations_locators_locs, curr_rtl_loc);
-      VEC_safe_push (location_t, heap, locations_locators_vals, &curr_location);
+      VEC_safe_push (location_t, heap, locations_locators_vals, curr_location);
       last_location = curr_location;
     }
   return curr_rtl_loc;
index ae5a11fdaa092ce4dd4c22887b7172a91ffaf347..9ba7aa8f6c974a0465cd5295fdecf2d9c26da825 100644 (file)
@@ -304,8 +304,8 @@ init_eh_for_function (void)
   cfun->eh = ggc_alloc_cleared_eh_status ();
 
   /* Make sure zero'th entries are used.  */
-  VEC_safe_push (eh_region, gc, cfun->eh->region_array, (eh_region) NULL);
-  VEC_safe_push (eh_landing_pad, gc, cfun->eh->lp_array, (eh_landing_pad) NULL);
+  VEC_safe_push (eh_region, gc, cfun->eh->region_array, NULL);
+  VEC_safe_push (eh_landing_pad, gc, cfun->eh->lp_array, NULL);
 }
 \f
 /* Routines to generate the exception tree somewhat directly.
@@ -806,7 +806,7 @@ add_ehspec_entry (htab_t ehspec_hash, htab_t ttypes_hash, tree list)
       if (targetm.arm_eabi_unwinder)
        VEC_safe_push (tree, gc, cfun->eh->ehspec_data.arm_eabi, NULL_TREE);
       else
-       VEC_safe_push (uchar, gc, cfun->eh->ehspec_data.other, (uchar) 0);
+       VEC_safe_push (uchar, gc, cfun->eh->ehspec_data.other, 0);
     }
 
   return n->filter;
index 8d7aa5fe3c3fc2344e1471502d02c8163970bca2..e843692e0200963043a86fe890e754a7c01c81fd 100644 (file)
@@ -1434,9 +1434,8 @@ gfc_trans_omp_do (gfc_code *code, stmtblock_t *pblock,
          /* Initialize DOVAR.  */
          tmp = fold_build2_loc (input_location, MULT_EXPR, type, count, step);
          tmp = fold_build2_loc (input_location, PLUS_EXPR, type, from, tmp);
-         di = VEC_safe_push (dovar_init, heap, inits, NULL);
-         di->var = dovar;
-         di->init = tmp;
+         dovar_init e = {dovar, tmp};
+         VEC_safe_push (dovar_init, heap, inits, e);
        }
 
       if (!dovar_found)
index e64e76da221a7217f5b621a5b3de5ae19bc94277..cb571cd6d97397807780e2fe03a8f9bc9dbd49ae 100644 (file)
@@ -223,7 +223,7 @@ single_def_use_enter_block (struct dom_walk_data *walk_data ATTRIBUTE_UNUSED,
   bitmap_copy (local_lr, &lr_bb_info->in);
 
   /* Push a marker for the leave_block callback.  */
-  VEC_safe_push (df_ref, heap, reg_defs_stack, (df_ref) NULL);
+  VEC_safe_push (df_ref, heap, reg_defs_stack, NULL);
 
   process_uses (df_get_artificial_uses (bb_index), DF_REF_AT_TOP);
   process_defs (df_get_artificial_defs (bb_index), DF_REF_AT_TOP);
index 5f68d5978e3b7c7ff5efa62887f3eaae25c6f9f0..af3c34acfebb8ae0e36223cd598239c875c32021 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2520,7 +2520,7 @@ execute (void)
      and record info about each one.
      Also search for the programs that are to be run.  */
 
-  VEC_safe_push (const_char_p, heap, argbuf, (const_char_p)0);
+  VEC_safe_push (const_char_p, heap, argbuf, 0);
 
   commands[0].prog = VEC_index (const_char_p, argbuf, 0); /* first command.  */
   commands[0].argv = VEC_address (const_char_p, argbuf);
index 767cc66edb5190999cce0e6ceb3ef3091e832edc..a066b36c642abb3bab1a7e7bbae72f533334fb76 100644 (file)
@@ -1417,7 +1417,7 @@ canon_list_insert (rtx dest ATTRIBUTE_UNUSED, const_rtx x ATTRIBUTE_UNUSED,
 {
   rtx dest_addr, insn;
   int bb;
-  modify_pair *pair;
+  modify_pair pair;
 
   while (GET_CODE (dest) == SUBREG
       || GET_CODE (dest) == ZERO_EXTRACT
@@ -1436,9 +1436,9 @@ canon_list_insert (rtx dest ATTRIBUTE_UNUSED, const_rtx x ATTRIBUTE_UNUSED,
   insn = (rtx) v_insn;
   bb = BLOCK_FOR_INSN (insn)->index;
 
-  pair = VEC_safe_push (modify_pair, heap, canon_modify_mem_list[bb], NULL);
-  pair->dest = dest;
-  pair->dest_addr = dest_addr;
+  pair.dest = dest;
+  pair.dest_addr = dest_addr;
+  VEC_safe_push (modify_pair, heap, canon_modify_mem_list[bb], pair);
 }
 
 /* Record memory modification information for INSN.  We do not actually care
index 122a4a4cfbeedf99adc75da6a299467c8a277fe5..46a398d1a6ec64a69758f75279551aec4ed1803a 100644 (file)
@@ -7752,8 +7752,7 @@ output_min_issue_delay_table (automaton_t automaton)
     = VEC_alloc (vect_el_t, heap, compressed_min_issue_delay_len);
 
   for (i = 0; i < compressed_min_issue_delay_len; i++)
-    VEC_quick_push (vect_el_t, compressed_min_issue_delay_vect,
-                   (vect_el_t) 0);
+    VEC_quick_push (vect_el_t, compressed_min_issue_delay_vect, 0);
 
   for (i = 0; i < min_issue_delay_len; i++)
     {
@@ -7845,7 +7844,7 @@ output_reserved_units_table (automaton_t automaton)
   reserved_units_table = VEC_alloc (vect_el_t, heap, reserved_units_size);
 
   for (i = 0; i < reserved_units_size; i++)
-    VEC_quick_push (vect_el_t, reserved_units_table, (vect_el_t) 0);
+    VEC_quick_push (vect_el_t, reserved_units_table, 0);
   for (n = 0; n < VEC_length (state_t, output_states_vect); n++)
     {
       state_t s = VEC_index (state_t, output_states_vect, n);
index 175febeb58f9ff3236c955a8dfc31ece02335045..fb1428687cafe2efe84aeeac99842ed3d1f8af73 100644 (file)
@@ -201,7 +201,7 @@ VEC_safe_set_locstr (VEC(locstr,heap) **vp, unsigned int ix, char *str)
   else
     {
       while (ix > VEC_length (locstr, *vp))
-       VEC_safe_push (locstr, heap, *vp, (locstr) NULL);
+       VEC_safe_push (locstr, heap, *vp, NULL);
       VEC_safe_push (locstr, heap, *vp, str);
     }
 }
index 52612794802c53ca92dec3571435b4614bfd90e7..e0ffc8f286cb17fb915a25f51097eec6e65f4cac 100644 (file)
@@ -265,7 +265,7 @@ gen_insn (rtx insn)
        {
          p.op = optabs[pindex].op;
          p.sort_num = (p.op << 16) | (p.m2 << 8) | p.m1;
-         VEC_safe_push (pattern, heap, patterns, &p);
+         VEC_safe_push (pattern, heap, patterns, p);
          return;
        }
     }
index 7a51e8c271ca0cbd113bc8ac9e7b9a9a255d895a..c5a16ac52d370003519fb4b0bddd1e82f4963db0 100644 (file)
@@ -851,7 +851,7 @@ lower_gimple_return (gimple_stmt_iterator *gsi, struct lower_data *data)
   /* Not found.  Create a new label and record the return statement.  */
   tmp_rs.label = create_artificial_label (cfun->function_end_locus);
   tmp_rs.stmt = stmt;
-  VEC_safe_push (return_statements_t, heap, data->return_statements, &tmp_rs);
+  VEC_safe_push (return_statements_t, heap, data->return_statements, tmp_rs);
 
   /* Generate a goto statement and remove the return statement.  */
  found:
index b66a193afeed3bba2a4f961aba9704d1b00bc961..892c561d6a32c9d149d993827751bb7de24dc066 100644 (file)
@@ -182,21 +182,22 @@ Expression::convert_for_assignment(Translate_context* context, Type* lhs_type,
 
       VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 3);
 
-      constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+      constructor_elt empty = {NULL, NULL};
+      constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
       tree field = TYPE_FIELDS(lhs_type_tree);
       go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),
                        "__values") == 0);
       elt->index = field;
       elt->value = fold_convert(TREE_TYPE(field), null_pointer_node);
 
-      elt = VEC_quick_push(constructor_elt, init, NULL);
+      elt = VEC_quick_push(constructor_elt, init, empty);
       field = DECL_CHAIN(field);
       go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),
                        "__count") == 0);
       elt->index = field;
       elt->value = fold_convert(TREE_TYPE(field), integer_zero_node);
 
-      elt = VEC_quick_push(constructor_elt, init, NULL);
+      elt = VEC_quick_push(constructor_elt, init, empty);
       field = DECL_CHAIN(field);
       go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),
                        "__capacity") == 0);
@@ -315,7 +316,8 @@ Expression::convert_type_to_interface(Translate_context* context,
 
   VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 2);
 
-  constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
   tree field = TYPE_FIELDS(lhs_type_tree);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),
                    (lhs_is_empty ? "__type_descriptor" : "__methods")) == 0);
@@ -323,7 +325,7 @@ Expression::convert_type_to_interface(Translate_context* context,
   elt->value = fold_convert_loc(location.gcc_location(), TREE_TYPE(field),
                                 first_field_value);
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__object") == 0);
   elt->index = field;
@@ -439,7 +441,8 @@ Expression::convert_interface_to_interface(Translate_context* context,
 
   VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 2);
 
-  constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
   tree field = TYPE_FIELDS(lhs_type_tree);
   elt->index = field;
 
@@ -502,7 +505,7 @@ Expression::convert_interface_to_interface(Translate_context* context,
 
   // The second field is simply the object pointer.
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__object") == 0);
   elt->index = field;
@@ -9959,20 +9962,21 @@ Array_index_expression::do_get_tree(Translate_context* context)
 
   VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 3);
 
-  constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
   tree field = TYPE_FIELDS(struct_tree);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__values") == 0);
   elt->index = field;
   elt->value = value_pointer;
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__count") == 0);
   elt->index = field;
   elt->value = fold_convert_loc(loc.gcc_location(), TREE_TYPE(field),
                                 result_length_tree);
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__capacity") == 0);
   elt->index = field;
@@ -11355,7 +11359,8 @@ Struct_construction_expression::do_get_tree(Translate_context* context)
       if (val == error_mark_node || TREE_TYPE(val) == error_mark_node)
        return error_mark_node;
 
-      constructor_elt* elt = VEC_quick_push(constructor_elt, elts, NULL);
+      constructor_elt empty = {NULL, NULL};
+      constructor_elt* elt = VEC_quick_push(constructor_elt, elts, empty);
       elt->index = field;
       elt->value = val;
       if (!TREE_CONSTANT(val))
@@ -11583,7 +11588,8 @@ Array_construction_expression::get_constructor_tree(Translate_context* context,
        {
          if (this->indexes_ != NULL)
            go_assert(pi != this->indexes_->end());
-         constructor_elt* elt = VEC_quick_push(constructor_elt, values, NULL);
+         constructor_elt empty = {NULL, NULL};
+         constructor_elt* elt = VEC_quick_push(constructor_elt, values, empty);
 
          if (this->indexes_ == NULL)
            elt->index = size_int(i);
@@ -11793,7 +11799,8 @@ Open_array_construction_expression::do_get_tree(Translate_context* context)
       if (constructor_type == error_mark_node)
        return error_mark_node;
       VEC(constructor_elt,gc)* vec = VEC_alloc(constructor_elt, gc, 1);
-      constructor_elt* elt = VEC_quick_push(constructor_elt, vec, NULL);
+      constructor_elt empty = {NULL, NULL};
+      constructor_elt* elt = VEC_quick_push(constructor_elt, vec, empty);
       elt->index = size_int(0);
       Gogo* gogo = context->gogo();
       Btype* btype = element_type->get_backend(gogo);
@@ -11886,19 +11893,20 @@ Open_array_construction_expression::do_get_tree(Translate_context* context)
 
   VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 3);
 
-  constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
   tree field = TYPE_FIELDS(type_tree);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__values") == 0);
   elt->index = field;
   elt->value = fold_convert(TREE_TYPE(field), space);
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__count") == 0);
   elt->index = field;
   elt->value = fold_convert(TREE_TYPE(field), length_tree);
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)),"__capacity") == 0);
   elt->index = field;
@@ -12102,7 +12110,8 @@ Map_construction_expression::do_get_tree(Translate_context* context)
 
          VEC(constructor_elt,gc)* one = VEC_alloc(constructor_elt, gc, 2);
 
-         constructor_elt* elt = VEC_quick_push(constructor_elt, one, NULL);
+         constructor_elt empty = {NULL, NULL};
+         constructor_elt* elt = VEC_quick_push(constructor_elt, one, empty);
          elt->index = key_field;
          tree val_tree = (*pv)->get_tree(context);
          elt->value = Expression::convert_for_assignment(context, key_type,
@@ -12115,7 +12124,7 @@ Map_construction_expression::do_get_tree(Translate_context* context)
 
          ++pv;
 
-         elt = VEC_quick_push(constructor_elt, one, NULL);
+         elt = VEC_quick_push(constructor_elt, one, empty);
          elt->index = val_field;
          val_tree = (*pv)->get_tree(context);
          elt->value = Expression::convert_for_assignment(context, val_type,
@@ -12126,7 +12135,7 @@ Map_construction_expression::do_get_tree(Translate_context* context)
          if (!TREE_CONSTANT(elt->value))
            one_is_constant = false;
 
-         elt = VEC_quick_push(constructor_elt, values, NULL);
+         elt = VEC_quick_push(constructor_elt, values, empty);
          elt->index = size_int(i);
          elt->value = build_constructor(struct_type, one);
          if (one_is_constant)
index c933d937596859a214d4aa7e82e632ebc817a42f..9a181a344aded1439ef0af2b811290379c3a49c1 100644 (file)
@@ -354,7 +354,8 @@ Gogo::register_gc_vars(const std::vector<Named_object*>& var_gc,
     {
       VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 2);
 
-      constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+      constructor_elt empty = {NULL, NULL};
+      constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
       tree field = TYPE_FIELDS(root_type);
       elt->index = field;
       Bvariable* bvar = (*p)->get_backend_variable(this, NULL);
@@ -362,12 +363,12 @@ Gogo::register_gc_vars(const std::vector<Named_object*>& var_gc,
       go_assert(TREE_CODE(decl) == VAR_DECL);
       elt->value = build_fold_addr_expr(decl);
 
-      elt = VEC_quick_push(constructor_elt, init, NULL);
+      elt = VEC_quick_push(constructor_elt, init, empty);
       field = DECL_CHAIN(field);
       elt->index = field;
       elt->value = DECL_SIZE_UNIT(decl);
 
-      elt = VEC_quick_push(constructor_elt, roots_init, NULL);
+      elt = VEC_quick_push(constructor_elt, roots_init, empty);
       elt->index = size_int(i);
       elt->value = build_constructor(root_type, init);
     }
@@ -376,17 +377,18 @@ Gogo::register_gc_vars(const std::vector<Named_object*>& var_gc,
 
   VEC(constructor_elt,gc)* init = VEC_alloc(constructor_elt, gc, 2);
 
-  constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
   tree field = TYPE_FIELDS(root_type);
   elt->index = field;
   elt->value = fold_convert(TREE_TYPE(field), null_pointer_node);
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   elt->index = field;
   elt->value = size_zero_node;
 
-  elt = VEC_quick_push(constructor_elt, roots_init, NULL);
+  elt = VEC_quick_push(constructor_elt, roots_init, empty);
   elt->index = size_int(i);
   elt->value = build_constructor(root_type, init);
 
@@ -394,12 +396,12 @@ Gogo::register_gc_vars(const std::vector<Named_object*>& var_gc,
 
   VEC(constructor_elt,gc)* root_list_init = VEC_alloc(constructor_elt, gc, 2);
 
-  elt = VEC_quick_push(constructor_elt, root_list_init, NULL);
+  elt = VEC_quick_push(constructor_elt, root_list_init, empty);
   field = TYPE_FIELDS(root_list_type);
   elt->index = field;
   elt->value = fold_convert(TREE_TYPE(field), null_pointer_node);
 
-  elt = VEC_quick_push(constructor_elt, root_list_init, NULL);
+  elt = VEC_quick_push(constructor_elt, root_list_init, empty);
   field = DECL_CHAIN(field);
   elt->index = field;
   elt->value = build_constructor(array_type, roots_init);
@@ -2029,7 +2031,8 @@ Gogo::go_string_constant_tree(const std::string& val)
 
   VEC(constructor_elt, gc)* init = VEC_alloc(constructor_elt, gc, 2);
 
-  constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
   tree field = TYPE_FIELDS(string_type);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__data") == 0);
   elt->index = field;
@@ -2037,7 +2040,7 @@ Gogo::go_string_constant_tree(const std::string& val)
   elt->value = fold_convert(TREE_TYPE(field),
                            build_fold_addr_expr(str));
 
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__length") == 0);
   elt->index = field;
@@ -2089,7 +2092,8 @@ Gogo::slice_constructor(tree slice_type_tree, tree values, tree count,
 
   tree field = TYPE_FIELDS(slice_type_tree);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__values") == 0);
-  constructor_elt* elt = VEC_quick_push(constructor_elt, init, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, init, empty);
   elt->index = field;
   go_assert(TYPE_MAIN_VARIANT(TREE_TYPE(field))
             == TYPE_MAIN_VARIANT(TREE_TYPE(values)));
@@ -2104,13 +2108,13 @@ Gogo::slice_constructor(tree slice_type_tree, tree values, tree count,
 
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__count") == 0);
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   elt->index = field;
   elt->value = fold_convert(TREE_TYPE(field), count);
 
   field = DECL_CHAIN(field);
   go_assert(strcmp(IDENTIFIER_POINTER(DECL_NAME(field)), "__capacity") == 0);
-  elt = VEC_quick_push(constructor_elt, init, NULL);
+  elt = VEC_quick_push(constructor_elt, init, empty);
   elt->index = field;
   elt->value = fold_convert(TREE_TYPE(field), capacity);
 
@@ -2170,7 +2174,8 @@ Gogo::interface_method_table_for_type(const Interface_type* interface,
                                                 count + 1);
 
   // The first element is the type descriptor.
-  constructor_elt* elt = VEC_quick_push(constructor_elt, pointers, NULL);
+  constructor_elt empty = {NULL, NULL};
+  constructor_elt* elt = VEC_quick_push(constructor_elt, pointers, empty);
   elt->index = size_zero_node;
   Type* td_type;
   if (!is_pointer)
@@ -2204,7 +2209,7 @@ Gogo::interface_method_table_for_type(const Interface_type* interface,
        go_unreachable();
       fndecl = build_fold_addr_expr(fndecl);
 
-      elt = VEC_quick_push(constructor_elt, pointers, NULL);
+      elt = VEC_quick_push(constructor_elt, pointers, empty);
       elt->index = size_int(i);
       elt->value = fold_convert(const_ptr_type_node, fndecl);
     }
index ded38f5af1a1aea7a244827abcf162cbbb6302f1..3a7b9101db90d3233bdef92353fe5586577c4c58 100644 (file)
@@ -1249,7 +1249,7 @@ build_sese_conditions_before (struct dom_walk_data *dw_data,
       if (e->flags & EDGE_TRUE_VALUE)
        VEC_safe_push (gimple, heap, *cases, stmt);
       else
-       VEC_safe_push (gimple, heap, *cases, (gimple) NULL);
+       VEC_safe_push (gimple, heap, *cases, NULL);
     }
 
   gbb = gbb_from_bb (bb);
index 97ae376a6588767beac04227af3dc96cf61e8816..613b606d1db7e228a52dc2c5aa72b5b5376cf2d0 100644 (file)
@@ -266,7 +266,7 @@ add_condition (struct inline_summary *summary, int operand_num,
   new_cond.agg_contents = agg_contents;
   new_cond.by_ref = by_ref;
   new_cond.offset = offset;
-  VEC_safe_push (condition, gc, summary->conds, &new_cond);
+  VEC_safe_push (condition, gc, summary->conds, new_cond);
   return single_cond_predicate (i + predicate_first_dynamic_condition);
 }
 
@@ -688,7 +688,7 @@ account_size_time (struct inline_summary *summary, int size, int time,
       new_entry.size = size;
       new_entry.time = time;
       new_entry.predicate = *pred;
-      VEC_safe_push (size_time_entry, gc, summary->entry, &new_entry);
+      VEC_safe_push (size_time_entry, gc, summary->entry, new_entry);
     }
   else
     {
@@ -3579,7 +3579,7 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data,
          c.by_ref = bp_unpack_value (&bp, 1);
          if (c.agg_contents)
            c.offset = streamer_read_uhwi (&ib);
-         VEC_safe_push (condition, gc, info->conds, &c);
+         VEC_safe_push (condition, gc, info->conds, c);
        }
       count2 = streamer_read_uhwi (&ib);
       gcc_assert (!info->entry);
@@ -3591,7 +3591,7 @@ inline_read_section (struct lto_file_decl_data *file_data, const char *data,
          e.time = streamer_read_uhwi (&ib);
          e.predicate = read_predicate (&ib);
 
-         VEC_safe_push (size_time_entry, gc, info->entry, &e);
+         VEC_safe_push (size_time_entry, gc, info->entry, e);
        }
      
       p = read_predicate (&ib);
index 8ee871cfe624623ca0360607fce5849b852b57e7..9729145b7a184d09ef775026f0eefe584151ffc6 100644 (file)
@@ -1342,11 +1342,10 @@ determine_known_aggregate_parts (gimple call, tree arg,
        {
          if (list->constant)
            {
-             struct ipa_agg_jf_item *item;
-             item = VEC_quick_push (ipa_agg_jf_item_t,
-                                    jfunc->agg.items, NULL);
-             item->offset = list->offset - arg_offset;
-             item->value = list->constant;
+             struct ipa_agg_jf_item item;
+             item.offset = list->offset - arg_offset;
+             item.value = list->constant;
+             VEC_quick_push (ipa_agg_jf_item_t, jfunc->agg.items, item);
            }
          list = list->next;
        }
@@ -3023,45 +3022,44 @@ ipa_combine_adjustments (ipa_parm_adjustment_vec inner,
       if (n->remove_param)
        removals++;
       else
-       VEC_quick_push (ipa_parm_adjustment_t, tmp, n);
+       VEC_quick_push (ipa_parm_adjustment_t, tmp, *n);
     }
 
   adjustments = VEC_alloc (ipa_parm_adjustment_t, heap, outlen + removals);
   for (i = 0; i < outlen; i++)
     {
-      struct ipa_parm_adjustment *r;
+      struct ipa_parm_adjustment r;
       struct ipa_parm_adjustment *out = &VEC_index (ipa_parm_adjustment_t,
                                                    outer, i);
       struct ipa_parm_adjustment *in = &VEC_index (ipa_parm_adjustment_t, tmp,
                                                   out->base_index);
 
+      memset (&r, 0, sizeof (r));
       gcc_assert (!in->remove_param);
       if (out->remove_param)
        {
          if (!index_in_adjustments_multiple_times_p (in->base_index, tmp))
            {
-             r = VEC_quick_push (ipa_parm_adjustment_t, adjustments, NULL);
-             memset (r, 0, sizeof (*r));
-             r->remove_param = true;
+             r.remove_param = true;
+             VEC_quick_push (ipa_parm_adjustment_t, adjustments, r);
            }
          continue;
        }
 
-      r = VEC_quick_push (ipa_parm_adjustment_t, adjustments, NULL);
-      memset (r, 0, sizeof (*r));
-      r->base_index = in->base_index;
-      r->type = out->type;
+      r.base_index = in->base_index;
+      r.type = out->type;
 
       /* FIXME:  Create nonlocal value too.  */
 
       if (in->copy_param && out->copy_param)
-       r->copy_param = true;
+       r.copy_param = true;
       else if (in->copy_param)
-       r->offset = out->offset;
+       r.offset = out->offset;
       else if (out->copy_param)
-       r->offset = in->offset;
+       r.offset = in->offset;
       else
-       r->offset = in->offset + out->offset;
+       r.offset = in->offset + out->offset;
+      VEC_quick_push (ipa_parm_adjustment_t, adjustments, r);
     }
 
   for (i = 0; i < inlen; i++)
@@ -3070,7 +3068,7 @@ ipa_combine_adjustments (ipa_parm_adjustment_vec inner,
                                                  inner, i);
 
       if (n->remove_param)
-       VEC_quick_push (ipa_parm_adjustment_t, adjustments, n);
+       VEC_quick_push (ipa_parm_adjustment_t, adjustments, *n);
     }
 
   VEC_free (ipa_parm_adjustment_t, heap, tmp);
@@ -3238,11 +3236,10 @@ ipa_read_jump_function (struct lto_input_block *ib,
     }
   for (i = 0; i < count; i++)
     {
-      struct ipa_agg_jf_item *item = VEC_quick_push (ipa_agg_jf_item_t,
-                                      jump_func->agg.items, NULL);
-
-      item->offset = streamer_read_uhwi (ib);
-      item->value = stream_read_tree (ib, data_in);
+      struct ipa_agg_jf_item item;
+      item.offset = streamer_read_uhwi (ib);
+      item.value = stream_read_tree (ib, data_in);
+      VEC_quick_push (ipa_agg_jf_item_t, jump_func->agg.items, item);
     }
 }
 
index be1d2cce2309626d5cc846ef5b85ee437cf3087c..e1d1c4928e67d729211189ebaf3748a4fcfaa2de 100644 (file)
@@ -912,7 +912,7 @@ find_split_points (int overall_time, int overall_size)
   first.set_ssa_names = 0;
   first.used_ssa_names = 0;
   first.bbs_visited = 0;
-  VEC_safe_push (stack_entry, heap, stack, &first);
+  VEC_safe_push (stack_entry, heap, stack, first);
   ENTRY_BLOCK_PTR->aux = (void *)(intptr_t)-1;
 
   while (!VEC_empty (stack_entry, stack))
@@ -994,7 +994,7 @@ find_split_points (int overall_time, int overall_size)
              new_entry.non_ssa_vars = BITMAP_ALLOC (NULL);
              new_entry.can_split = true;
              bitmap_set_bit (new_entry.bbs_visited, dest->index);
-             VEC_safe_push (stack_entry, heap, stack, &new_entry);
+             VEC_safe_push (stack_entry, heap, stack, new_entry);
              dest->aux = (void *)(intptr_t)VEC_length (stack_entry, stack);
            }
          /* Back edge found, record the earliest point.  */
index f806cea141488542fd962c9ab7596211b7dab0c5..a89b83183b62622feac1e0c5c90cdc38f5969aa9 100644 (file)
@@ -2198,9 +2198,10 @@ make_class_data (tree type)
 
       for (i = 0; i < count; i++)
        {
-         constructor_elt *elt = VEC_quick_push (constructor_elt, v, NULL);
-         elt->index = build_int_cst (sizetype, i);
-         elt->value = build_int_cstu (byte_type_node, data[i]);
+         constructor_elt elt;
+         elt.index = build_int_cst (sizetype, i);
+         elt.value = build_int_cstu (byte_type_node, data[i]);
+         VEC_quick_push (constructor_elt, v, elt);
        }
 
       DECL_INITIAL (array) = build_constructor (type, v);
index 0429c02ca34c202f3b4d13a664555eb8ec43c8be..8041cdd99c417f528a985c2466c281916600ad4e 100644 (file)
@@ -2296,14 +2296,13 @@ get_symbol_table_index (tree t, tree special,
 {
   method_entry *e;
   unsigned i;
+  method_entry elem = {t, special};
 
   FOR_EACH_VEC_ELT (method_entry, *symbol_table, i, e)
     if (t == e->method && special == e->special)
       goto done;
 
-  e = VEC_safe_push (method_entry, gc, *symbol_table, NULL);
-  e->method = t;
-  e->special = special;
+  VEC_safe_push (method_entry, gc, *symbol_table, elem);
 
  done:
   return i + 1;
index 6223d1a6a5761d9aa8aa11f7506ad29b7440a154..24222883da4e7f44c1dca8c551f9401f0fe2c094 100644 (file)
@@ -114,7 +114,7 @@ lto_symtab_encoder_encode (lto_symtab_encoder_t encoder,
       if (!slot)
         slot = pointer_map_insert (encoder->map, node);
       *slot = (void *) (intptr_t) (ref + 1);
-      VEC_safe_push (lto_encoder_entry, heap, encoder->nodes, &entry);
+      VEC_safe_push (lto_encoder_entry, heap, encoder->nodes, entry);
     }
   else
     ref = (size_t) *slot - 1;
index 4f47a5790876ae65e436a62a80a0fbe964d7aa3e..cf899d379bd14082878a637cc5d66089f395b089 100644 (file)
@@ -1068,7 +1068,7 @@ objc_v2_get_class_reference (tree ident)
   decl = build_v2_class_reference_decl (ident);
   e.ident = ident;
   e.data = decl;
-  VEC_safe_push (ident_data_tuple, gc, classrefs, &e);
+  VEC_safe_push (ident_data_tuple, gc, classrefs, e);
   return decl;
 }
 
@@ -1233,7 +1233,7 @@ build_v2_selector_messenger_reference (tree sel_name, tree message_func_decl)
   e.func = message_func_decl;
   e.selname = sel_name;
   e.refdecl = decl;
-  VEC_safe_push (msgref_entry, gc, msgrefs, &e);
+  VEC_safe_push (msgref_entry, gc, msgrefs, e);
   return decl;
 }
 
@@ -1290,7 +1290,7 @@ objc_v2_get_protocol_reference (tree ident)
   decl = build_v2_protocollist_ref_decl (ident);
   e.id = ident;
   e.refdecl = decl;
-  VEC_safe_push (prot_list_entry, gc, protrefs, &e);
+  VEC_safe_push (prot_list_entry, gc, protrefs, e);
   return decl;
 }
 
@@ -1476,7 +1476,7 @@ next_runtime_abi_02_get_class_super_ref (location_t loc ATTRIBUTE_UNUSED,
   decl = build_v2_superclass_ref_decl (id, inst_meth);
   e.ident = id;
   e.data = decl;
-  VEC_safe_push (ident_data_tuple, gc, list, &e);
+  VEC_safe_push (ident_data_tuple, gc, list, e);
   return decl;
 }
 
@@ -2126,7 +2126,7 @@ objc_add_to_protocol_list (tree protocol_interface_decl, tree protocol_decl)
     protlist = VEC_alloc (prot_list_entry, gc, 32);
   e.id = protocol_interface_decl;
   e.refdecl = protocol_decl;
-  VEC_safe_push (prot_list_entry, gc, protlist, &e);
+  VEC_safe_push (prot_list_entry, gc, protlist, e);
 }
 
 /* Build the __protocol_list section table containing address of all
@@ -2806,7 +2806,7 @@ ivar_offset_ref (tree class_name, tree field_decl)
 
   e.decl = decl;
   e.offset = byte_position (field_decl);
-  VEC_safe_push (ivarref_entry, gc, ivar_offset_refs, &e);
+  VEC_safe_push (ivarref_entry, gc, ivar_offset_refs, e);
   return decl;
 }
 
@@ -3082,7 +3082,7 @@ objc_v2_add_to_ehtype_list (tree name)
   /* Not found, or new list.  */
   e.ident = name;
   e.data = NULL_TREE;
-  VEC_safe_push (ident_data_tuple, gc, ehtype_list, &e);
+  VEC_safe_push (ident_data_tuple, gc, ehtype_list, e);
 }
 
 static void
index 354bce07dc2c155893a3c76efa5077d5974931e0..e024537fa0fc332d49917c973d40da7c7fcba149 100644 (file)
@@ -1144,12 +1144,8 @@ set_option (struct gcc_options *opts, struct gcc_options *opts_set,
        {
          VEC(cl_deferred_option,heap) *vec
            = (VEC(cl_deferred_option,heap) *) *(void **) flag_var;
-         cl_deferred_option *p;
-
-         p = VEC_safe_push (cl_deferred_option, heap, vec, NULL);
-         p->opt_index = opt_index;
-         p->arg = arg;
-         p->value = value;
+         cl_deferred_option p = {opt_index, arg, value};
+         VEC_safe_push (cl_deferred_option, heap, vec, p);
          *(void **) flag_var = vec;
          if (set_flag_var)
            *(void **) set_flag_var = vec;
index 71ecf5376421738c8bd8d7442b5a4d73e82ce4b8..30c2fb69484eaf5f42016d8e21fbd07dd1ef415a 100644 (file)
@@ -684,11 +684,8 @@ validate_const_int (const char *string)
 static void
 record_iterator_use (struct mapping *iterator, void *ptr)
 {
-  struct iterator_use *iuse;
-
-  iuse = VEC_safe_push (iterator_use, heap, iterator_uses, NULL);
-  iuse->iterator = iterator;
-  iuse->ptr = ptr;
+  struct iterator_use iuse = {iterator, ptr};
+  VEC_safe_push (iterator_use, heap, iterator_uses, iuse);
 }
 
 /* Record that PTR uses attribute VALUE, which must match a built-in
@@ -698,12 +695,8 @@ static void
 record_attribute_use (struct iterator_group *group, void *ptr,
                      const char *value)
 {
-  struct attribute_use *ause;
-
-  ause = VEC_safe_push (attribute_use, heap, attribute_uses, NULL);
-  ause->group = group;
-  ause->value = value;
-  ause->ptr = ptr;
+  struct attribute_use ause = {group, value, ptr};
+  VEC_safe_push (attribute_use, heap, attribute_uses, ause);
 }
 
 /* Interpret NAME as either a built-in value, iterator or attribute
index 1d0f1949b800cfdf4da5ac57abc5db4b1758edfc..99ecd578097318ec095d53ccb658845ce17e02e0 100644 (file)
--- a/gcc/ree.c
+++ b/gcc/ree.c
@@ -816,11 +816,8 @@ add_removable_extension (const_rtx expr, rtx insn,
 
       /* Then add the candidate to the list and insert the reaching definitions
          into the definition map.  */
-      cand = VEC_safe_push (ext_cand, heap, *insn_list, NULL);
-      cand->expr = expr;
-      cand->code = code;
-      cand->mode = mode;
-      cand->insn = insn;
+      ext_cand e = {expr, code, mode, insn};
+      VEC_safe_push (ext_cand, heap, *insn_list, e);
       idx = VEC_length (ext_cand, *insn_list);
 
       for (def = defs; def; def = def->next)
index 77c7ba0911ae63ab97236f3343f56ebd6f47ce1e..1bcdfad9377e6bb0602b9cac5953c75938628d75 100644 (file)
@@ -659,15 +659,12 @@ grow_reg_equivs (void)
   int old_size = VEC_length (reg_equivs_t, reg_equivs);
   int max_regno = max_reg_num ();
   int i;
+  reg_equivs_t ze;
 
+  memset (&ze, 0, sizeof (reg_equivs_t));
   VEC_reserve (reg_equivs_t, gc, reg_equivs, max_regno);
   for (i = old_size; i < max_regno; i++)
-    {
-      VEC_quick_insert (reg_equivs_t, reg_equivs, i, 0);
-      memset (&VEC_index (reg_equivs_t, reg_equivs, i), 0,
-             sizeof (reg_equivs_t));
-    }
-    
+    VEC_quick_insert (reg_equivs_t, reg_equivs, i, ze);
 }
 
 \f
index 1f1095ecfed09eda561f49655067f3ed7f4b801d..2a7a17066f623a701180b94a9ece1adc814339db 100644 (file)
@@ -1542,7 +1542,7 @@ insert_in_history_vect (VEC (expr_history_def, heap) **pvect,
 
   vinsn_attach (old_expr_vinsn);
   vinsn_attach (new_expr_vinsn);
-  VEC_safe_insert (expr_history_def, heap, vect, ind, &temp);
+  VEC_safe_insert (expr_history_def, heap, vect, ind, temp);
   *pvect = vect;
 }
 
index be020dab8099c838da280a5062750446904a189f..c879548483b7729e52bab4ad9e743c857ad2ec57 100644 (file)
@@ -374,7 +374,7 @@ gen_conditions_for_domain (tree arg, inp_domain domain,
     {
       /* Now push a separator.  */
       if (domain.has_lb)
-        VEC_quick_push (gimple, conds, (gimple)NULL);
+        VEC_quick_push (gimple, conds, NULL);
 
       gen_one_condition (arg, domain.ub,
                          (domain.is_ub_inclusive
@@ -496,7 +496,7 @@ gen_conditions_for_pow_int_base (tree base, tree expn,
      type is integer.  */
 
   /* Push a separator.  */
-  VEC_quick_push (gimple, conds, (gimple)NULL);
+  VEC_quick_push (gimple, conds, NULL);
 
   temp = create_tmp_var (int_type, "DCE_COND1");
   cst0 = build_int_cst (int_type, 0);
index 38327b0d2c394410e91c97b225f4598e026115df..0f68fdf4020a2887e64f92ff8afbdacccb5a6260 100644 (file)
@@ -4300,7 +4300,7 @@ static bool
 get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
 {
   bool clobbers_memory = false;
-  data_ref_loc *ref;
+  data_ref_loc ref;
   tree *op0, *op1;
   enum gimple_code stmt_code = gimple_code (stmt);
 
@@ -4329,9 +4329,9 @@ get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
              && (base = get_base_address (*op1))
              && TREE_CODE (base) != SSA_NAME))
        {
-         ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
-         ref->pos = op1;
-         ref->is_read = true;
+         ref.pos = op1;
+         ref.is_read = true;
+         VEC_safe_push (data_ref_loc, heap, *references, ref);
        }
     }
   else if (stmt_code == GIMPLE_CALL)
@@ -4347,9 +4347,9 @@ get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
          if (DECL_P (*op1)
              || (REFERENCE_CLASS_P (*op1) && get_base_address (*op1)))
            {
-             ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
-             ref->pos = op1;
-             ref->is_read = true;
+             ref.pos = op1;
+             ref.is_read = true;
+             VEC_safe_push (data_ref_loc, heap, *references, ref);
            }
        }
     }
@@ -4360,9 +4360,9 @@ get_references_in_stmt (gimple stmt, VEC (data_ref_loc, heap) **references)
       && (DECL_P (*op0)
          || (REFERENCE_CLASS_P (*op0) && get_base_address (*op0))))
     {
-      ref = VEC_safe_push (data_ref_loc, heap, *references, NULL);
-      ref->pos = op0;
-      ref->is_read = false;
+      ref.pos = op0;
+      ref.is_read = false;
+      VEC_safe_push (data_ref_loc, heap, *references, ref);
     }
   return clobbers_memory;
 }
index f8f10a42276530e732194dc80e338d4a54d1444a..423923fb66ad7f7239cfeec4646947cbc174f417 100644 (file)
@@ -729,7 +729,7 @@ dump_enumerated_decls_push (tree *tp, int *walk_subtrees, void *data)
     return NULL_TREE;
   nt.t = *tp;
   nt.num = VEC_length (numbered_tree, *list);
-  VEC_safe_push (numbered_tree, heap, *list, &nt);
+  VEC_safe_push (numbered_tree, heap, *list, nt);
   *walk_subtrees = 0;
   return NULL_TREE;
 }
index 1276cbea6afded84bd83be0fc05ee6b4b89b4cec..2756ed21374d254fb4006e6e4261c81f1505c057 100644 (file)
@@ -127,7 +127,7 @@ maybe_unwind_expanded_macro_loc (diagnostic_context *context,
       loc.where = where;
       loc.map = map;
 
-      VEC_safe_push (loc_map_pair, heap, loc_vec, &loc);
+      VEC_safe_push (loc_map_pair, heap, loc_vec, loc);
 
       /* WHERE is the location of a token inside the expansion of a
          macro.  MAP is the map holding the locations of that macro
index b30469c8e597b52717cd652b9eeaf34222fbde7c..88e77dace601a253f734166803da9a7146eba5bc 100644 (file)
@@ -149,29 +149,29 @@ tree
 default_emutls_var_init (tree to, tree decl, tree proxy)
 {
   VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 4);
-  constructor_elt *elt;
+  constructor_elt elt;
   tree type = TREE_TYPE (to);
   tree field = TYPE_FIELDS (type);
 
-  elt = VEC_quick_push (constructor_elt, v, NULL);
-  elt->index = field;
-  elt->value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
+  elt.index = field;
+  elt.value = fold_convert (TREE_TYPE (field), DECL_SIZE_UNIT (decl));
+  VEC_quick_push (constructor_elt, v, elt);
 
-  elt = VEC_quick_push (constructor_elt, v, NULL);
   field = DECL_CHAIN (field);
-  elt->index = field;
-  elt->value = build_int_cst (TREE_TYPE (field),
-                             DECL_ALIGN_UNIT (decl));
+  elt.index = field;
+  elt.value = build_int_cst (TREE_TYPE (field),
+                            DECL_ALIGN_UNIT (decl));
+  VEC_quick_push (constructor_elt, v, elt);
 
-  elt = VEC_quick_push (constructor_elt, v, NULL);
   field = DECL_CHAIN (field);
-  elt->index = field;
-  elt->value = null_pointer_node;
+  elt.index = field;
+  elt.value = null_pointer_node;
+  VEC_quick_push (constructor_elt, v, elt);
 
-  elt = VEC_quick_push (constructor_elt, v, NULL);
   field = DECL_CHAIN (field);
-  elt->index = field;
-  elt->value = proxy;
+  elt.index = field;
+  elt.value = proxy;
+  VEC_quick_push (constructor_elt, v, elt);
 
   return build_constructor (type, v);
 }
index aafaa15a805bece41a91ca2d83e314f5feee1906..ef3f5f99ed6bc79ff42d6539a1a60793d5bf8b48 100644 (file)
@@ -3999,7 +3999,7 @@ splice_all_param_accesses (VEC (access_p, heap) **representatives)
            result = UNUSED_PARAMS;
        }
       else
-       VEC_quick_push (access_p, *representatives, (access_p) NULL);
+       VEC_quick_push (access_p, *representatives, NULL);
     }
 
   if (result == NO_GOOD_ACCESS)
@@ -4050,36 +4050,35 @@ turn_representatives_into_adjustments (VEC (access_p, heap) *representatives,
 
       if (!repr || no_accesses_p (repr))
        {
-         struct ipa_parm_adjustment *adj;
+         struct ipa_parm_adjustment adj;
 
-         adj = VEC_quick_push (ipa_parm_adjustment_t, adjustments, NULL);
-         memset (adj, 0, sizeof (*adj));
-         adj->base_index = get_param_index (parm, parms);
-         adj->base = parm;
+         memset (&adj, 0, sizeof (adj));
+         adj.base_index = get_param_index (parm, parms);
+         adj.base = parm;
          if (!repr)
-           adj->copy_param = 1;
+           adj.copy_param = 1;
          else
-           adj->remove_param = 1;
+           adj.remove_param = 1;
+         VEC_quick_push (ipa_parm_adjustment_t, adjustments, adj);
        }
       else
        {
-         struct ipa_parm_adjustment *adj;
+         struct ipa_parm_adjustment adj;
          int index = get_param_index (parm, parms);
 
          for (; repr; repr = repr->next_grp)
            {
-             adj = VEC_quick_push (ipa_parm_adjustment_t, adjustments, NULL);
-             memset (adj, 0, sizeof (*adj));
+             memset (&adj, 0, sizeof (adj));
              gcc_assert (repr->base == parm);
-             adj->base_index = index;
-             adj->base = repr->base;
-             adj->type = repr->type;
-             adj->alias_ptr_type = reference_alias_ptr_type (repr->expr);
-             adj->offset = repr->offset;
-             adj->by_ref = (POINTER_TYPE_P (TREE_TYPE (repr->base))
-                            && (repr->grp_maybe_modified
-                                || repr->grp_not_necessarilly_dereferenced));
-
+             adj.base_index = index;
+             adj.base = repr->base;
+             adj.type = repr->type;
+             adj.alias_ptr_type = reference_alias_ptr_type (repr->expr);
+             adj.offset = repr->offset;
+             adj.by_ref = (POINTER_TYPE_P (TREE_TYPE (repr->base))
+                           && (repr->grp_maybe_modified
+                               || repr->grp_not_necessarilly_dereferenced));
+             VEC_quick_push (ipa_parm_adjustment_t, adjustments, adj);
            }
        }
     }
index 4a89df25fbbe0b97f91ef1955cfbecc3087e6ab1..9065006c55ed5cbbb5eaebd5c5980f516a4cd19a 100644 (file)
@@ -1231,7 +1231,7 @@ build_and_record_new_cond (enum tree_code code,
   cond->ops.binary.opnd1 = op1;
 
   c.value = boolean_true_node;
-  VEC_safe_push (cond_equivalence, heap, *p, &c);
+  VEC_safe_push (cond_equivalence, heap, *p, c);
 }
 
 /* Record that COND is true and INVERTED is false into the edge information
@@ -1338,7 +1338,7 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
      two slots.  */
   initialize_expr_from_cond (cond, &c.cond);
   c.value = boolean_true_node;
-  VEC_safe_push (cond_equivalence, heap, edge_info->cond_equivalences, &c);
+  VEC_safe_push (cond_equivalence, heap, edge_info->cond_equivalences, c);
 
   /* It is possible for INVERTED to be the negation of a comparison,
      and not a valid RHS or GIMPLE_COND condition.  This happens because
@@ -1347,7 +1347,7 @@ record_conditions (struct edge_info *edge_info, tree cond, tree inverted)
      obey the trichotomy law.  */
   initialize_expr_from_cond (inverted, &c.cond);
   c.value = boolean_false_node;
-  VEC_safe_push (cond_equivalence, heap, edge_info->cond_equivalences, &c);
+  VEC_safe_push (cond_equivalence, heap, edge_info->cond_equivalences, c);
 }
 
 /* A helper function for record_const_or_copy and record_equality.
index 9e217b5f0a45c18206df61c172f27d4f83cf34fc..64f538e344f43b20c73f6c189e2e999081272200 100644 (file)
@@ -4773,7 +4773,7 @@ init_pre (bool do_fre)
 
   next_expression_id = 1;
   expressions = NULL;
-  VEC_safe_push (pre_expr, heap, expressions, (pre_expr)NULL);
+  VEC_safe_push (pre_expr, heap, expressions, NULL);
   value_expressions = VEC_alloc (bitmap, heap, get_max_value_id () + 1);
   VEC_safe_grow_cleared (bitmap, heap, value_expressions,
                         get_max_value_id() + 1);
index 2b1298d14025dbbf8150f69afa2674c853d7d8f8..960e2c3c38962507728dfa2136f730072785d425 100644 (file)
@@ -1344,7 +1344,7 @@ undistribute_ops_list (enum tree_code opcode,
          c.cnt = 1;
          c.id = next_oecount_id++;
          c.op = oe1->op;
-         VEC_safe_push (oecount, heap, cvec, &c);
+         VEC_safe_push (oecount, heap, cvec, c);
          idx = VEC_length (oecount, cvec) + 41;
          slot = htab_find_slot (ctable, (void *)idx, INSERT);
          if (!*slot)
@@ -3118,7 +3118,7 @@ attempt_builtin_powi (gimple stmt, VEC(operand_entry_t, heap) **ops)
              rfnew.rank = oe->rank;
              rfnew.count = oe->count;
              rfnew.repr = NULL_TREE;
-             VEC_safe_push (repeat_factor, heap, repeat_factor_vec, &rfnew);
+             VEC_safe_push (repeat_factor, heap, repeat_factor_vec, rfnew);
            }
        }
     }
index 5cc88ae224203c5eca8c2fb53fc6bacb149884a6..9a370e8ab3cb174bf91beac2d44d367b8b6454bb 100644 (file)
@@ -591,21 +591,21 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
       temp.op1 = TMR_STEP (ref);
       temp.op2 = TMR_OFFSET (ref);
       temp.off = -1;
-      VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+      VEC_safe_push (vn_reference_op_s, heap, *result, temp);
 
       memset (&temp, 0, sizeof (temp));
       temp.type = NULL_TREE;
       temp.opcode = ERROR_MARK;
       temp.op0 = TMR_INDEX2 (ref);
       temp.off = -1;
-      VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+      VEC_safe_push (vn_reference_op_s, heap, *result, temp);
 
       memset (&temp, 0, sizeof (temp));
       temp.type = NULL_TREE;
       temp.opcode = TREE_CODE (TMR_BASE (ref));
       temp.op0 = TMR_BASE (ref);
       temp.off = -1;
-      VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+      VEC_safe_push (vn_reference_op_s, heap, *result, temp);
       return;
     }
 
@@ -700,7 +700,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
          temp.opcode = MEM_REF;
          temp.op0 = build_int_cst (build_pointer_type (TREE_TYPE (ref)), 0);
          temp.off = 0;
-         VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+         VEC_safe_push (vn_reference_op_s, heap, *result, temp);
          temp.opcode = ADDR_EXPR;
          temp.op0 = build_fold_addr_expr (ref);
          temp.type = TREE_TYPE (temp.op0);
@@ -739,7 +739,7 @@ copy_reference_ops_from_ref (tree ref, VEC(vn_reference_op_s, heap) **result)
        default:
          gcc_unreachable ();
        }
-      VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+      VEC_safe_push (vn_reference_op_s, heap, *result, temp);
 
       if (REFERENCE_CLASS_P (ref)
          || TREE_CODE (ref) == MODIFY_EXPR
@@ -949,7 +949,7 @@ copy_reference_ops_from_call (gimple call,
       temp.type = TREE_TYPE (lhs);
       temp.op0 = lhs;
       temp.off = -1;
-      VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+      VEC_safe_push (vn_reference_op_s, heap, *result, temp);
     }
 
   /* Copy the type, opcode, function being called and static chain.  */
@@ -959,7 +959,7 @@ copy_reference_ops_from_call (gimple call,
   temp.op0 = gimple_call_fn (call);
   temp.op1 = gimple_call_chain (call);
   temp.off = -1;
-  VEC_safe_push (vn_reference_op_s, heap, *result, &temp);
+  VEC_safe_push (vn_reference_op_s, heap, *result, temp);
 
   /* Copy the call arguments.  As they can be references as well,
      just chain them together.  */
@@ -3766,7 +3766,7 @@ start_over:
            {
              /* Recurse by pushing the current use walking state on
                 the stack and starting over.  */
-             VEC_safe_push(ssa_op_iter, heap, itervec, &iter);
+             VEC_safe_push(ssa_op_iter, heap, itervec, iter);
              VEC_safe_push(tree, heap, namevec, name);
              name = use;
              goto start_over;
index 4969edc4b5bc600295b8e4b7736e5d6656e7b17b..688b0688b82831fd04b0b8e8f046eb6dc586b3e7 100644 (file)
@@ -826,7 +826,7 @@ constraint_expr_less (struct constraint_expr a, struct constraint_expr b)
    arbitrary, but consistent, in order to give them an ordering.  */
 
 static bool
-constraint_less (const constraint_t a, const constraint_t b)
+constraint_less (const constraint_t &a, const constraint_t &b)
 {
   if (constraint_expr_less (a->lhs, b->lhs))
     return true;
@@ -2793,12 +2793,12 @@ get_constraint_for_ssa_var (tree t, VEC(ce_s, heap) **results, bool address_p)
       for (; vi; vi = vi->next)
        {
          cexpr.var = vi->id;
-         VEC_safe_push (ce_s, heap, *results, &cexpr);
+         VEC_safe_push (ce_s, heap, *results, cexpr);
        }
       return;
     }
 
-  VEC_safe_push (ce_s, heap, *results, &cexpr);
+  VEC_safe_push (ce_s, heap, *results, cexpr);
 }
 
 /* Process constraint T, performing various simplifications and then
@@ -2945,7 +2945,7 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
              c2.type = ADDRESSOF;
              c2.offset = 0;
              if (c2.var != c.var)
-               VEC_safe_push (ce_s, heap, *results, &c2);
+               VEC_safe_push (ce_s, heap, *results, c2);
              temp = temp->next;
            }
          while (temp);
@@ -2980,7 +2980,7 @@ get_constraint_for_ptr_offset (tree ptr, tree offset,
              c2.var = temp->next->id;
              c2.type = ADDRESSOF;
              c2.offset = 0;
-             VEC_safe_push (ce_s, heap, *results, &c2);
+             VEC_safe_push (ce_s, heap, *results, c2);
            }
          c.var = temp->id;
          c.offset = 0;
@@ -3024,7 +3024,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
       temp.offset = 0;
       temp.var = integer_id;
       temp.type = SCALAR;
-      VEC_safe_push (ce_s, heap, *results, &temp);
+      VEC_safe_push (ce_s, heap, *results, temp);
       return;
     }
 
@@ -3046,7 +3046,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
            temp.offset = 0;
            temp.var = anything_id;
            temp.type = ADDRESSOF;
-           VEC_safe_push (ce_s, heap, *results, &temp);
+           VEC_safe_push (ce_s, heap, *results, temp);
            return;
          }
     }
@@ -3087,7 +3087,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
                                    bitpos, bitmaxsize))
                {
                  cexpr.var = curr->id;
-                 VEC_safe_push (ce_s, heap, *results, &cexpr);
+                 VEC_safe_push (ce_s, heap, *results, cexpr);
                  if (address_p)
                    break;
                }
@@ -3102,7 +3102,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
              while (curr->next != NULL)
                curr = curr->next;
              cexpr.var = curr->id;
-             VEC_safe_push (ce_s, heap, *results, &cexpr);
+             VEC_safe_push (ce_s, heap, *results, cexpr);
            }
          else if (VEC_length (ce_s, *results) == 0)
            /* Assert that we found *some* field there. The user couldn't be
@@ -3115,7 +3115,7 @@ get_constraint_for_component_ref (tree t, VEC(ce_s, heap) **results,
              cexpr.type = SCALAR;
              cexpr.var = anything_id;
              cexpr.offset = 0;
-             VEC_safe_push (ce_s, heap, *results, &cexpr);
+             VEC_safe_push (ce_s, heap, *results, cexpr);
            }
        }
       else if (bitmaxsize == 0)
@@ -3239,7 +3239,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
        temp.var = nonlocal_id;
       temp.type = ADDRESSOF;
       temp.offset = 0;
-      VEC_safe_push (ce_s, heap, *results, &temp);
+      VEC_safe_push (ce_s, heap, *results, temp);
       return;
     }
 
@@ -3249,7 +3249,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
       temp.var = readonly_id;
       temp.type = SCALAR;
       temp.offset = 0;
-      VEC_safe_push (ce_s, heap, *results, &temp);
+      VEC_safe_push (ce_s, heap, *results, temp);
       return;
     }
 
@@ -3310,7 +3310,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
                      if (curr->offset - vi->offset < size)
                        {
                          cs.var = curr->id;
-                         VEC_safe_push (ce_s, heap, *results, &cs);
+                         VEC_safe_push (ce_s, heap, *results, cs);
                        }
                      else
                        break;
@@ -3352,7 +3352,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
                  unsigned j;
                  get_constraint_for_1 (val, &tmp, address_p, lhs_p);
                  FOR_EACH_VEC_ELT (ce_s, tmp, j, rhsp)
-                   VEC_safe_push (ce_s, heap, *results, rhsp);
+                   VEC_safe_push (ce_s, heap, *results, *rhsp);
                  VEC_truncate (ce_s, tmp, 0);
                }
              VEC_free (ce_s, heap, tmp);
@@ -3376,7 +3376,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
        temp.type = ADDRESSOF;
        temp.var = nonlocal_id;
        temp.offset = 0;
-       VEC_safe_push (ce_s, heap, *results, &temp);
+       VEC_safe_push (ce_s, heap, *results, temp);
        return;
       }
     default:;
@@ -3386,7 +3386,7 @@ get_constraint_for_1 (tree t, VEC (ce_s, heap) **results, bool address_p,
   temp.type = ADDRESSOF;
   temp.var = anything_id;
   temp.offset = 0;
-  VEC_safe_push (ce_s, heap, *results, &temp);
+  VEC_safe_push (ce_s, heap, *results, temp);
 }
 
 /* Given a gimple tree T, return the constraint expression vector for it.  */
@@ -3793,7 +3793,7 @@ handle_rhs_call (gimple stmt, VEC(ce_s, heap) **results)
       rhsc.var = get_call_use_vi (stmt)->id;
       rhsc.offset = 0;
       rhsc.type = SCALAR;
-      VEC_safe_push (ce_s, heap, *results, &rhsc);
+      VEC_safe_push (ce_s, heap, *results, rhsc);
     }
 
   /* The static chain escapes as well.  */
@@ -3820,7 +3820,7 @@ handle_rhs_call (gimple stmt, VEC(ce_s, heap) **results)
   rhsc.var = nonlocal_id;
   rhsc.offset = 0;
   rhsc.type = SCALAR;
-  VEC_safe_push (ce_s, heap, *results, &rhsc);
+  VEC_safe_push (ce_s, heap, *results, rhsc);
 }
 
 /* For non-IPA mode, generate constraints necessary for a call
@@ -3845,7 +3845,7 @@ handle_lhs_call (gimple stmt, tree lhs, int flags, VEC(ce_s, heap) *rhsc,
       tmpc.var = escaped_id;
       tmpc.offset = 0;
       tmpc.type = SCALAR;
-      VEC_safe_push (ce_s, heap, lhsc, &tmpc);
+      VEC_safe_push (ce_s, heap, lhsc, tmpc);
     }
 
   /* If the call returns an argument unmodified override the rhs
@@ -3880,7 +3880,7 @@ handle_lhs_call (gimple stmt, tree lhs, int flags, VEC(ce_s, heap) *rhsc,
       tmpc.var = vi->id;
       tmpc.offset = 0;
       tmpc.type = ADDRESSOF;
-      VEC_safe_push (ce_s, heap, rhsc, &tmpc);
+      VEC_safe_push (ce_s, heap, rhsc, tmpc);
       process_all_all_constraints (lhsc, rhsc);
       VEC_free (ce_s, heap, rhsc);
     }
@@ -3909,7 +3909,7 @@ handle_const_call (gimple stmt, VEC(ce_s, heap) **results)
       rhsc.var = uses->id;
       rhsc.offset = 0;
       rhsc.type = SCALAR;
-      VEC_safe_push (ce_s, heap, *results, &rhsc);
+      VEC_safe_push (ce_s, heap, *results, rhsc);
     }
 
   /* May return arguments.  */
@@ -3921,7 +3921,7 @@ handle_const_call (gimple stmt, VEC(ce_s, heap) **results)
       struct constraint_expr *argp;
       get_constraint_for_rhs (arg, &argc);
       FOR_EACH_VEC_ELT (ce_s, argc, i, argp)
-       VEC_safe_push (ce_s, heap, *results, argp);
+       VEC_safe_push (ce_s, heap, *results, *argp);
       VEC_free(ce_s, heap, argc);
     }
 
@@ -3929,7 +3929,7 @@ handle_const_call (gimple stmt, VEC(ce_s, heap) **results)
   rhsc.var = nonlocal_id;
   rhsc.offset = 0;
   rhsc.type = ADDRESSOF;
-  VEC_safe_push (ce_s, heap, *results, &rhsc);
+  VEC_safe_push (ce_s, heap, *results, rhsc);
 }
 
 /* For non-IPA mode, generate constraints necessary for a call to a
@@ -3971,12 +3971,12 @@ handle_pure_call (gimple stmt, VEC(ce_s, heap) **results)
       rhsc.var = uses->id;
       rhsc.offset = 0;
       rhsc.type = SCALAR;
-      VEC_safe_push (ce_s, heap, *results, &rhsc);
+      VEC_safe_push (ce_s, heap, *results, rhsc);
     }
   rhsc.var = nonlocal_id;
   rhsc.offset = 0;
   rhsc.type = SCALAR;
-  VEC_safe_push (ce_s, heap, *results, &rhsc);
+  VEC_safe_push (ce_s, heap, *results, rhsc);
 }
 
 
@@ -4412,7 +4412,7 @@ find_func_aliases_for_call (gimple t)
              && DECL_BY_REFERENCE (DECL_RESULT (fndecl)))
            {
              VEC(ce_s, heap) *tem = NULL;
-             VEC_safe_push (ce_s, heap, tem, &rhs);
+             VEC_safe_push (ce_s, heap, tem, rhs);
              do_deref (&tem);
              rhs = VEC_index (ce_s, tem, 0);
              VEC_free(ce_s, heap, tem);
@@ -4549,7 +4549,7 @@ find_func_aliases (gimple origt)
              get_constraint_for_rhs (gimple_assign_rhs2 (t), &rhsc);
              get_constraint_for_rhs (gimple_assign_rhs3 (t), &tmp);
              FOR_EACH_VEC_ELT (ce_s, tmp, i, rhsp)
-               VEC_safe_push (ce_s, heap, rhsc, rhsp);
+               VEC_safe_push (ce_s, heap, rhsc, *rhsp);
              VEC_free (ce_s, heap, tmp);
            }
          else if (truth_value_p (code))
@@ -4567,7 +4567,7 @@ find_func_aliases (gimple origt)
                {
                  get_constraint_for_rhs (gimple_op (t, i), &tmp);
                  FOR_EACH_VEC_ELT (ce_s, tmp, j, rhsp)
-                   VEC_safe_push (ce_s, heap, rhsc, rhsp);
+                   VEC_safe_push (ce_s, heap, rhsc, *rhsp);
                  VEC_truncate (ce_s, tmp, 0);
                }
              VEC_free (ce_s, heap, tmp);
@@ -5191,13 +5191,8 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
            if (!pair
                && offset + foff != 0)
              {
-               pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
-               pair->offset = 0;
-               pair->size = offset + foff;
-               pair->has_unknown_size = false;
-               pair->must_have_pointers = false;
-               pair->may_have_pointers = false;
-               pair->only_restrict_pointers = false;
+               fieldoff_s e = {0, offset + foff, false, false, false, false};
+               pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, e);
              }
 
            if (!DECL_SIZE (field)
@@ -5217,19 +5212,20 @@ push_fields_onto_fieldstack (tree type, VEC(fieldoff_s,heap) **fieldstack,
              }
            else
              {
-               pair = VEC_safe_push (fieldoff_s, heap, *fieldstack, NULL);
-               pair->offset = offset + foff;
-               pair->has_unknown_size = has_unknown_size;
+               fieldoff_s e;
+               e.offset = offset + foff;
+               e.has_unknown_size = has_unknown_size;
                if (!has_unknown_size)
-                 pair->size = TREE_INT_CST_LOW (DECL_SIZE (field));
+                 e.size = TREE_INT_CST_LOW (DECL_SIZE (field));
                else
-                 pair->size = -1;
-               pair->must_have_pointers = must_have_pointers_p;
-               pair->may_have_pointers = true;
-               pair->only_restrict_pointers
+                 e.size = -1;
+               e.must_have_pointers = must_have_pointers_p;
+               e.may_have_pointers = true;
+               e.only_restrict_pointers
                  = (!has_unknown_size
                     && POINTER_TYPE_P (TREE_TYPE (field))
                     && TYPE_RESTRICT (TREE_TYPE (field)));
+               VEC_safe_push (fieldoff_s, heap, *fieldstack, e);
              }
          }
 
index f8eb723303557b9f155c0d49fa0ae0566475c56a..7ba11e193d6f3d959dc3e98f3431032d5dce53a1 100644 (file)
@@ -68,7 +68,7 @@ redirect_edge_var_map_add (edge e, tree result, tree def, source_location locus)
   new_node.result = result;
   new_node.locus = locus;
 
-  VEC_safe_push (edge_var_map, heap, head, &new_node);
+  VEC_safe_push (edge_var_map, heap, head, new_node);
   if (old_head != head)
     {
       /* The push did some reallocation.  Update the pointer map.  */
index bb89d30fc320c6279abcd5a747d1887eca042a4a..bbbd3caca021be86476c40f2b82b09a875ec4efc 100644 (file)
@@ -868,13 +868,11 @@ build_constructors (gimple swtch, struct switch_conv_info *info)
          int k;
          for (k = 0; k < info->phi_count; k++)
            {
-             constructor_elt *elt;
+             constructor_elt elt;
 
-             elt = VEC_quick_push (constructor_elt,
-                                   info->constructors[k], NULL);
-             elt->index = int_const_binop (MINUS_EXPR, pos,
-                                           info->range_min);
-             elt->value = info->default_values[k];
+             elt.index = int_const_binop (MINUS_EXPR, pos, info->range_min);
+             elt.value = info->default_values[k];
+             VEC_quick_push (constructor_elt, info->constructors[k], elt);
            }
 
          pos = int_const_binop (PLUS_EXPR, pos, integer_one_node);
@@ -896,12 +894,11 @@ build_constructors (gimple swtch, struct switch_conv_info *info)
 
          do
            {
-             constructor_elt *elt;
+             constructor_elt elt;
 
-             elt = VEC_quick_push (constructor_elt,
-                                   info->constructors[j], NULL);
-             elt->index = int_const_binop (MINUS_EXPR, pos, info->range_min);
-             elt->value = val;
+             elt.index = int_const_binop (MINUS_EXPR, pos, info->range_min);
+             elt.value = val;
+             VEC_quick_push (constructor_elt, info->constructors[j], elt);
 
              pos = int_const_binop (PLUS_EXPR, pos, integer_one_node);
            } while (!tree_int_cst_lt (high, pos)
index 5b583124cab2c0a6d34670626f9536f99fe00aea..b217b1123e97087af70fc2f07822f834087aafbd 100644 (file)
@@ -252,9 +252,8 @@ expand_vector_piecewise (gimple_stmt_iterator *gsi, elem_op_func f,
        i += delta, index = int_const_binop (PLUS_EXPR, index, part_width))
     {
       tree result = f (gsi, inner_type, a, b, index, part_width, code);
-      constructor_elt *ce = VEC_quick_push (constructor_elt, v, NULL);
-      ce->index = NULL_TREE;
-      ce->value = result;
+      constructor_elt ce = {NULL_TREE, result};
+      VEC_quick_push (constructor_elt, v, ce);
     }
 
   return build_constructor (type, v);
index fb354ae28d1e100e87b315a03c7978e47d63cbc0..508dff0f714a51c7b5f3be12dbf48850c3d263a7 100644 (file)
@@ -214,7 +214,7 @@ adjust_debug_stmts (tree from, tree to, basic_block bb)
       ai.bb = bb;
 
       if (adjust_vec)
-       VEC_safe_push (adjust_info, stack, adjust_vec, &ai);
+       VEC_safe_push (adjust_info, stack, adjust_vec, ai);
       else
        adjust_debug_stmts_now (&ai);
     }
index b2d0a6b4042d9e44f46c41167a049a5f1b4b0b9a..11dbdfb5a02436f3c1f513beeb0eccc5ee6be8d4 100644 (file)
@@ -1099,7 +1099,7 @@ vect_slp_rearrange_stmts (slp_tree node, unsigned int group_size,
   tmp_stmts = VEC_alloc (gimple, heap, group_size);
 
   for (i = 0; i < group_size; i++)
-    VEC_safe_push (gimple, heap, tmp_stmts, (gimple)NULL);
+    VEC_safe_push (gimple, heap, tmp_stmts, NULL);
 
   FOR_EACH_VEC_ELT (gimple, SLP_TREE_SCALAR_STMTS (node), i, stmt)
     {
@@ -2663,7 +2663,7 @@ vect_create_mask_and_perm (gimple stmt, gimple next_scalar_stmt,
      stmts later.  */
   for (i = VEC_length (gimple, SLP_TREE_VEC_STMTS (node));
        i < (int) SLP_TREE_NUMBER_OF_VEC_STMTS (node); i++)
-    VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (node), (gimple)NULL);
+    VEC_quick_push (gimple, SLP_TREE_VEC_STMTS (node), NULL);
 
   perm_dest = vect_create_destination_var (gimple_assign_lhs (stmt), vectype);
   for (i = 0; i < ncopies; i++)
index 76418386e1a70808d53e00d065486b44c67dca05..bad0fa24191606923e2a2829009a5ea3579591e0 100644 (file)
@@ -94,7 +94,7 @@ add_stmt_info_to_vec (stmt_vector_for_cost *stmt_cost_vec, int count,
   si.kind = kind;
   si.stmt = stmt;
   si.misalign = misalign;
-  VEC_safe_push (stmt_info_for_cost, heap, *stmt_cost_vec, &si);
+  VEC_safe_push (stmt_info_for_cost, heap, *stmt_cost_vec, si);
 }
 
 /************************************************************************
index 47c68d8710c74f68a28fde7dd0be8785e57baade..c0a4050a812f099e8ea83afb0e308dfdadec4337 100644 (file)
@@ -8493,7 +8493,7 @@ simplify_switch_using_ranges (gimple stmt)
   /* And queue an update for the stmt.  */
   su.stmt = stmt;
   su.vec = vec2;
-  VEC_safe_push (switch_update, heap, to_update_switch_stmts, &su);
+  VEC_safe_push (switch_update, heap, to_update_switch_stmts, su);
   return false;
 }
 
index 469f47356c89f8a5c9f049e73a737c361391359e..a7492de8a92bc3d990c5eb2756e856e89f663e2c 100644 (file)
@@ -1443,12 +1443,10 @@ tree
 build_constructor_single (tree type, tree index, tree value)
 {
   VEC(constructor_elt,gc) *v;
-  constructor_elt *elt;
+  constructor_elt elt = {index, value};
 
   v = VEC_alloc (constructor_elt, gc, 1);
-  elt = VEC_quick_push (constructor_elt, v, NULL);
-  elt->index = index;
-  elt->value = value;
+  VEC_quick_push (constructor_elt, v, elt);
 
   return build_constructor (type, v);
 }
index d81aa3c423cb7e62909ef8326a622cab4aa53742..ab5dd1e3f594e2afef4e5fe4d8c6fa3231f3d578 100644 (file)
@@ -1546,9 +1546,8 @@ struct GTY(()) tree_vec {
 /* Append a new constructor element to V, with the specified INDEX and VAL.  */
 #define CONSTRUCTOR_APPEND_ELT(V, INDEX, VALUE) \
   do { \
-    constructor_elt *_ce___ = VEC_safe_push (constructor_elt, gc, V, NULL); \
-    _ce___->index = INDEX; \
-    _ce___->value = VALUE; \
+    constructor_elt _ce___ = {INDEX, VALUE}; \
+    VEC_safe_push (constructor_elt, gc, V, _ce___); \
   } while (0)
 
 /* True if NODE, a FIELD_DECL, is to be processed as a bitfield for
index 818fb2456b55b53046ce6d5c17550dd61822d5fb..8c9ec48c2408cb6972c588772e05aa2f5d1c92ff 100644 (file)
@@ -5510,7 +5510,7 @@ add_uses (rtx *ploc, void *data)
 
       if (dump_file && (dump_flags & TDF_DETAILS))
        log_op_type (mo.u.loc, cui->bb, cui->insn, mo.type, dump_file);
-      VEC_safe_push (micro_operation, heap, VTI (bb)->mos, &mo);
+      VEC_safe_push (micro_operation, heap, VTI (bb)->mos, mo);
     }
 
   return 0;
@@ -5794,7 +5794,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
          if (dump_file && (dump_flags & TDF_DETAILS))
            log_op_type (moa.u.loc, cui->bb, cui->insn,
                         moa.type, dump_file);
-         VEC_safe_push (micro_operation, heap, VTI (bb)->mos, &moa);
+         VEC_safe_push (micro_operation, heap, VTI (bb)->mos, moa);
        }
 
       resolve = false;
@@ -5881,7 +5881,7 @@ add_stores (rtx loc, const_rtx expr, void *cuip)
  log_and_return:
   if (dump_file && (dump_flags & TDF_DETAILS))
     log_op_type (mo.u.loc, cui->bb, cui->insn, mo.type, dump_file);
-  VEC_safe_push (micro_operation, heap, VTI (bb)->mos, &mo);
+  VEC_safe_push (micro_operation, heap, VTI (bb)->mos, mo);
 }
 
 /* Arguments to the call.  */
@@ -6300,7 +6300,7 @@ add_with_sets (rtx insn, struct cselib_set *sets, int n_sets)
 
       if (dump_file && (dump_flags & TDF_DETAILS))
        log_op_type (PATTERN (insn), bb, insn, mo.type, dump_file);
-      VEC_safe_push (micro_operation, heap, VTI (bb)->mos, &mo);
+      VEC_safe_push (micro_operation, heap, VTI (bb)->mos, mo);
     }
 
   n1 = VEC_length (micro_operation, VTI (bb)->mos);
@@ -7864,7 +7864,9 @@ loc_exp_insert_dep (variable var, rtx x, htab_t vars)
     led = (loc_exp_dep *) pool_alloc (loc_exp_dep_pool);
   else
     {
-      VEC_quick_push (loc_exp_dep, VAR_LOC_DEP_VEC (var), NULL);
+      loc_exp_dep empty;
+      memset (&empty, 0, sizeof (empty));
+      VEC_quick_push (loc_exp_dep, VAR_LOC_DEP_VEC (var), empty);
       led = &VEC_last (loc_exp_dep, VAR_LOC_DEP_VEC (var));
     }
   led->dv = var->dv;
@@ -9815,7 +9817,7 @@ vt_initialize (void)
                            log_op_type (PATTERN (insn), bb, insn,
                                         MO_ADJUST, dump_file);
                          VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
-                                        &mo);
+                                        mo);
                          VTI (bb)->out.stack_adjust += pre;
                        }
                    }
@@ -9847,7 +9849,7 @@ vt_initialize (void)
                        log_op_type (PATTERN (insn), bb, insn,
                                     MO_ADJUST, dump_file);
                      VEC_safe_push (micro_operation, heap, VTI (bb)->mos,
-                                    &mo);
+                                    mo);
                      VTI (bb)->out.stack_adjust += post;
                    }
 
index d476b8ad7cd89dd760628212b566214a5efc9522..a587c80fd34271b4a713bebe087b07e2644f4a61 100644 (file)
@@ -2999,9 +2999,8 @@ copy_constant (tree exp)
                                                      CONSTRUCTOR_ELTS (exp)));
        FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (exp), idx, purpose, value)
          {
-           constructor_elt *ce = VEC_quick_push (constructor_elt, v, NULL);
-           ce->index = purpose;
-           ce->value = copy_constant (value);
+           constructor_elt ce = {purpose, copy_constant (value)};
+           VEC_quick_push (constructor_elt, v, ce);
          }
        CONSTRUCTOR_ELTS (copy) = v;
        return copy;
@@ -5563,9 +5562,8 @@ assemble_alias (tree decl, tree target)
     do_assemble_alias (decl, target);
   else
     {
-      alias_pair *p = VEC_safe_push (alias_pair, gc, alias_pairs, NULL);
-      p->decl = decl;
-      p->target = target;
+      alias_pair p = {decl, target};
+      VEC_safe_push (alias_pair, gc, alias_pairs, p);
     }
 }
 
@@ -5628,14 +5626,9 @@ static int
 dump_tm_clone_to_vec (void **slot, void *info)
 {
   struct tree_map *map = (struct tree_map *) *slot;
-  VEC(tm_alias_pair,heap) **tm_alias_pairs
-    = (VEC(tm_alias_pair, heap) **) info;
-  tm_alias_pair *p;
-
-  p = VEC_safe_push (tm_alias_pair, heap, *tm_alias_pairs, NULL);
-  p->from = map->base.from;
-  p->to = map->to;
-  p->uid = DECL_UID (p->from);
+  VEC(tm_alias_pair,heap) **tm_alias_pairs = (VEC(tm_alias_pair, heap) **) info;
+  tm_alias_pair p = {DECL_UID (map->base.from), map->base.from, map->to};
+  VEC_safe_push (tm_alias_pair, heap, *tm_alias_pairs, p);
   return 1;
 }
 
index fbf95d22682073884cf9c284849041ddde4e1a58..88891d74d7fad43aa131dffa4ce88be9b01aed32 100644 (file)
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -178,19 +178,15 @@ struct GTY(()) vec_t
 
   bool space (int VEC_CHECK_DECL);
   void splice (vec_t<T> * VEC_CHECK_DECL);
-  T &quick_push (T VEC_CHECK_DECL);
-  T *quick_push (const T * VEC_CHECK_DECL);
+  T *quick_push (const T & VEC_CHECK_DECL);
   T &pop (ALONE_VEC_CHECK_DECL);
   void truncate (unsigned VEC_CHECK_DECL);
-  void replace (unsigned, T VEC_CHECK_DECL);
-  void quick_insert (unsigned, T VEC_CHECK_DECL);
-  void quick_insert (unsigned, const T * VEC_CHECK_DECL);
+  void replace (unsigned, const T & VEC_CHECK_DECL);
+  void quick_insert (unsigned, const T & VEC_CHECK_DECL);
   void ordered_remove (unsigned VEC_CHECK_DECL);
   void unordered_remove (unsigned VEC_CHECK_DECL);
   void block_remove (unsigned, unsigned VEC_CHECK_DECL);
-
-  unsigned lower_bound (T, bool (*)(T, T)) const;
-  unsigned lower_bound (const T *, bool (*)(const T *, const T *)) const;
+  unsigned lower_bound (T, bool (*)(const T &, const T &)) const;
 
   /* Class-static member functions.  Some of these will become member
      functions of a future handler class wrapping vec_t.  */
@@ -221,10 +217,7 @@ struct GTY(()) vec_t
                           MEM_STAT_DECL);
 
   template<enum vec_allocation_t A>
-  static T &safe_push (vec_t<T> **, T VEC_CHECK_DECL MEM_STAT_DECL);
-
-  template<enum vec_allocation_t A>
-  static T *safe_push (vec_t<T> **, const T * VEC_CHECK_DECL MEM_STAT_DECL);
+  static T *safe_push (vec_t<T> **, const T & VEC_CHECK_DECL MEM_STAT_DECL);
 
   template<enum vec_allocation_t A>
   static void safe_grow (vec_t<T> **, int VEC_CHECK_DECL MEM_STAT_DECL);
@@ -233,11 +226,7 @@ struct GTY(()) vec_t
   static void safe_grow_cleared (vec_t<T> **, int VEC_CHECK_DECL MEM_STAT_DECL);
 
   template<enum vec_allocation_t A>
-  static void safe_insert (vec_t<T> **, unsigned, T * VEC_CHECK_DECL
-                          MEM_STAT_DECL);
-
-  template<enum vec_allocation_t A>
-  static void safe_insert (vec_t<T> **, unsigned, T obj VEC_CHECK_DECL
+  static void safe_insert (vec_t<T> **, unsigned, const T & VEC_CHECK_DECL
                           MEM_STAT_DECL);
 
   static bool iterate (const vec_t<T> *, unsigned, T *);
@@ -802,63 +791,32 @@ vec_t<T>::safe_splice (vec_t<T> **dst, vec_t<T> *src VEC_CHECK_DECL
 }
 
   
-/* Push OBJ (a new element) onto the end, returns a reference to the slot
-   filled in.  There must be sufficient space in the vector.  */
-
-template<typename T>
-T &
-vec_t<T>::quick_push (T obj VEC_CHECK_DECL)
-{
-  VEC_ASSERT (prefix_.num_ < prefix_.alloc_, "push", T, base);
-  vec_[prefix_.num_] = obj;
-  T &val = vec_[prefix_.num_];
-  prefix_.num_++;
-  return val;
-}
+/* Push OBJ (a new element) onto the end of the vector.  There must be
+   sufficient space in the vector.  Return a pointer to the slot
+   where OBJ was inserted.  */
 
 
-/* Push PTR (a new pointer to an element) onto the end, returns a
-   pointer to the slot filled in. The new value can be NULL, in which
-   case NO initialization is performed.  There must be sufficient
-   space in the vector.  */
-
 template<typename T>
 T *
-vec_t<T>::quick_push (const T *ptr VEC_CHECK_DECL)
+vec_t<T>::quick_push (const T &obj VEC_CHECK_DECL)
 {
   VEC_ASSERT (prefix_.num_ < prefix_.alloc_, "push", T, base);
   T *slot = &vec_[prefix_.num_++];
-  if (ptr)
-    *slot = *ptr;
+  *slot = obj;
   return slot;
 }
 
 
-/* Push a new element OBJ onto the end of VEC.  Returns a reference to
-   the slot filled in.  Reallocates V, if needed.  */
-
-template<typename T>
-template<enum vec_allocation_t A>
-T &
-vec_t<T>::safe_push (vec_t<T> **vec, T obj VEC_CHECK_DECL MEM_STAT_DECL)
-{
-  reserve<A> (vec, 1 VEC_CHECK_PASS PASS_MEM_STAT);
-  return (*vec)->quick_push (obj VEC_CHECK_PASS);
-}
-
-
-/* Push a pointer PTR to a new element onto the end of VEC.  Returns a
-   pointer to the slot filled in. For object vectors, the new value
-   can be NULL, in which case NO initialization is performed.
-   Reallocates VEC, if needed.  */
+/* Push a new element OBJ onto the end of VEC.  Reallocates VEC, if
+   needed.  Return a pointer to the slot where OBJ was inserted.  */
 
 template<typename T>
 template<enum vec_allocation_t A>
 T *
-vec_t<T>::safe_push (vec_t<T> **vec, const T *ptr VEC_CHECK_DECL MEM_STAT_DECL)
+vec_t<T>::safe_push (vec_t<T> **vec, const T &obj VEC_CHECK_DECL MEM_STAT_DECL)
 {
   reserve<A> (vec, 1 VEC_CHECK_PASS PASS_MEM_STAT);
-  return (*vec)->quick_push (ptr VEC_CHECK_PASS);
+  return (*vec)->quick_push (obj VEC_CHECK_PASS);
 }
 
 
@@ -923,7 +881,7 @@ vec_t<T>::safe_grow_cleared (vec_t<T> **vec, int size VEC_CHECK_DECL
 
 template<typename T>
 void
-vec_t<T>::replace (unsigned ix, obj VEC_CHECK_DECL)
+vec_t<T>::replace (unsigned ix, const T &obj VEC_CHECK_DECL)
 {
   VEC_ASSERT (ix < prefix_.num_, "replace", T, base);
   vec_[ix] = obj;
@@ -935,7 +893,7 @@ vec_t<T>::replace (unsigned ix, T obj VEC_CHECK_DECL)
 
 template<typename T>
 void
-vec_t<T>::quick_insert (unsigned ix, obj VEC_CHECK_DECL)
+vec_t<T>::quick_insert (unsigned ix, const T &obj VEC_CHECK_DECL)
 {
   VEC_ASSERT (prefix_.num_ < prefix_.alloc_, "insert", T, base);
   VEC_ASSERT (ix <= prefix_.num_, "insert", T, base);
@@ -945,30 +903,13 @@ vec_t<T>::quick_insert (unsigned ix, T obj VEC_CHECK_DECL)
 }
 
 
-/* Insert an element, *PTR, at the IXth position of V.  The new value
-   can be NULL, in which case no initialization of the inserted slot
-   takes place. There must be sufficient space.  */
-
-template<typename T>
-void
-vec_t<T>::quick_insert (unsigned ix, const T *ptr VEC_CHECK_DECL)
-{
-  VEC_ASSERT (prefix_.num_ < prefix_.alloc_, "insert", T, base);
-  VEC_ASSERT (ix <= prefix_.num_, "insert", T, base);
-  T *slot = &vec_[ix];
-  memmove (slot + 1, slot, (prefix_.num_++ - ix) * sizeof (T));
-  if (ptr)
-    *slot = *ptr;
-}
-
-
-/* Insert an element, VAL, at the IXth position of VEC. Reallocate
+/* Insert an element, OBJ, at the IXth position of VEC. Reallocate
    VEC, if necessary.  */
 
 template<typename T>
 template<enum vec_allocation_t A>
 void
-vec_t<T>::safe_insert (vec_t<T> **vec, unsigned ix, obj VEC_CHECK_DECL
+vec_t<T>::safe_insert (vec_t<T> **vec, unsigned ix, const T &obj VEC_CHECK_DECL
                       MEM_STAT_DECL)
 {
   reserve<A> (vec, 1 VEC_CHECK_PASS PASS_MEM_STAT);
@@ -976,22 +917,6 @@ vec_t<T>::safe_insert (vec_t<T> **vec, unsigned ix, T obj VEC_CHECK_DECL
 }
 
 
-/* Insert an element, *PTR, at the IXth position of VEC. Return a pointer
-   to the slot created.  For vectors of object, the new value can be
-   NULL, in which case no initialization of the inserted slot takes
-   place. Reallocate V, if necessary.  */
-
-template<typename T>
-template<enum vec_allocation_t A>
-void
-vec_t<T>::safe_insert (vec_t<T> **vec, unsigned ix, T *ptr VEC_CHECK_DECL
-                      MEM_STAT_DECL)
-{
-  reserve<A> (vec, 1 VEC_CHECK_PASS PASS_MEM_STAT);
-  (*vec)->quick_insert (ix, ptr VEC_CHECK_PASS);
-}
-
-
 /* Remove an element from the IXth position of this vector.  Ordering of
    remaining elements is preserved.  This is an O(N) operation due to
    a memmove.  */
@@ -1043,14 +968,14 @@ vec_t<T>::block_remove (unsigned ix, unsigned len VEC_CHECK_DECL)
 
 template<typename T>
 unsigned
-vec_t<T>::lower_bound (T obj, bool (*lessthan)(T, T)) const
+vec_t<T>::lower_bound (T obj, bool (*lessthan)(const T &, const T &)) const
 {
   unsigned int len = VEC_length (T, this);
   unsigned int half, middle;
   unsigned int first = 0;
   while (len > 0)
     {
-      half = len >> 1;
+      half = len / 2;
       middle = first;
       middle += half;
       T middle_elem = (*this)[middle];
@@ -1067,38 +992,6 @@ vec_t<T>::lower_bound (T obj, bool (*lessthan)(T, T)) const
 }
 
 
-/* Find and return the first position in which *PTR could be inserted
-   without changing the ordering of this vector.  LESSTHAN is a
-   function that returns true if the first argument is strictly less
-   than the second.  */
-
-template<typename T>
-unsigned
-vec_t<T>::lower_bound (const T *ptr,
-                      bool (*lessthan)(const T *, const T *)) const
-{
-  unsigned int len = VEC_length (T, this);
-  unsigned int half, middle;
-  unsigned int first = 0;
-  while (len > 0)
-    {
-      half = len >> 1;
-      middle = first;
-      middle += half;
-      const T *middle_elem = &(*this)[middle];
-      if (lessthan (middle_elem, ptr))
-       {
-         first = middle;
-         ++first;
-         len = len - half - 1;
-       }
-      else
-       len = half;
-    }
-  return first;
-}
-
-
 void *vec_heap_o_reserve_1 (void *, int, size_t, size_t, bool MEM_STAT_DECL);
 void *vec_gc_o_reserve_1 (void *, int, size_t, size_t, bool MEM_STAT_DECL);