From: Richard Guenther Date: Mon, 26 Jun 2006 18:18:22 +0000 (+0000) Subject: tree.c (build_string): Do not waste tail padding in struct tree_string. X-Git-Tag: releases/gcc-4.2.0~2268 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=28df01acc444605ff9f10a74609ee3709a36bcae;p=thirdparty%2Fgcc.git tree.c (build_string): Do not waste tail padding in struct tree_string. 2006-06-26 Richard Guenther * tree.c (build_string): Do not waste tail padding in struct tree_string. From-SVN: r115021 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ea09b8d83038..ae7bf358c0ec 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-06-26 Richard Guenther + + * tree.c (build_string): Do not waste tail padding in + struct tree_string. + 2006-06-26 Richard Guenther * ggc-page.c (init_ggc): Add missing element to size_lookup diff --git a/gcc/tree.c b/gcc/tree.c index cbf4cc51eed7..e0e6716c2f69 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]++;