OSDN Git Service

2006-06-26 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Jun 2006 18:18:22 +0000 (18:18 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 26 Jun 2006 18:18:22 +0000 (18:18 +0000)
* tree.c (build_string): Do not waste tail padding in
struct tree_string.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115021 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree.c

index ea09b8d..ae7bf35 100644 (file)
@@ -1,5 +1,10 @@
 2006-06-26  Richard Guenther  <rguenther@suse.de>
 
+       * tree.c (build_string): Do not waste tail padding in
+       struct tree_string.
+
+2006-06-26  Richard Guenther  <rguenther@suse.de>
+
        * ggc-page.c (init_ggc): Add missing element to size_lookup
        table.
 
index cbf4cc5..e0e6716 100644 (file)
@@ -1120,8 +1120,9 @@ build_string (int len, const char *str)
 {
   tree s;
   size_t length;
-  
-  length = len + sizeof (struct tree_string);
+
+  /* Do not waste bytes provided by padding of struct tree_string.  */
+  length = len + offsetof (struct tree_string, str) + 1;
 
 #ifdef GATHER_STATISTICS
   tree_node_counts[(int) c_kind]++;