This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PR target/54631] Update vxworks.c to new VEC_quick_push interface


Tested by building stage 1 on i686-wrs-vxworks.  Robert, please
verify that the fix actually works for you.

Thanks.  Diego.

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

	PR target/54631
	* config/vxworks.c (vxworks_emutls_var_init): Update for new
	VEC_quick_push interface.

diff --git a/gcc/config/vxworks.c b/gcc/config/vxworks.c
index d88f03f..9eeefc0 100644
--- a/gcc/config/vxworks.c
+++ b/gcc/config/vxworks.c
@@ -97,24 +97,22 @@ static tree
 vxworks_emutls_var_init (tree var, tree decl, tree tmpl_addr)
 {
   VEC(constructor_elt,gc) *v = VEC_alloc (constructor_elt, gc, 3);
-  constructor_elt *elt;
   
   tree type = TREE_TYPE (var);
   tree field = TYPE_FIELDS (type);
   
-  elt = VEC_quick_push (constructor_elt, v, NULL);
-  elt->index = field;
-  elt->value = fold_convert (TREE_TYPE (field), tmpl_addr);
+  constructor_elt elt = {field, fold_convert (TREE_TYPE (field), tmpl_addr)};
+  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), 0);
+  elt.index = field;
+  elt.value = build_int_cst (TREE_TYPE (field), 0);
+  VEC_quick_push (constructor_elt, v, elt);
   
-  elt = VEC_quick_push (constructor_elt, v, NULL);
   field = DECL_CHAIN (field);
-  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);
   
   return build_constructor (type, v);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]