aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea09b8d..ae7bf35 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/tree.c b/gcc/tree.c
index cbf4cc5..e0e6716 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -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]++;