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]

tree.c patch in tree_cons use memset to initailise node.


Hi

Here a patch which changes yet another instance of the bogus (int *)
initialisation optimization to use the memset() routine.

Graham

ChangeLog

	* tree.c (tree_cons): Use memset to initialise node. 

*** tree.c.orig	Mon May 10 22:12:47 1999
--- tree.c	Thu May 13 20:21:43 1999
*************** tree_cons (purpose, value, chain)
*** 2073,2087 ****
  #if 0
    register tree node = make_node (TREE_LIST);
  #else
-   register int i;
    register tree node = (tree) obstack_alloc (current_obstack, sizeof
(struct tree_list));
  #ifdef GATHER_STATISTICS
    tree_node_counts[(int)x_kind]++;
    tree_node_sizes[(int)x_kind] += sizeof (struct tree_list);
  #endif
  
!   for (i = (sizeof (struct tree_common) / sizeof (int)) - 1; i >= 0;
i--)
!     ((int *) node)[i] = 0;
  
    TREE_SET_CODE (node, TREE_LIST);
    if (current_obstack == &permanent_obstack)
--- 2073,2085 ----
  #if 0
    register tree node = make_node (TREE_LIST);
  #else
    register tree node = (tree) obstack_alloc (current_obstack, sizeof
(struct tree_list));
  #ifdef GATHER_STATISTICS
    tree_node_counts[(int)x_kind]++;
    tree_node_sizes[(int)x_kind] += sizeof (struct tree_list);
  #endif
  
!   memset ((char *)node, 0, sizeof (struct tree_common));
  
    TREE_SET_CODE (node, TREE_LIST);
    if (current_obstack == &permanent_obstack)


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