tree.c (tree_size): Do not waste tail padding in struct tree_string and make the...
authorAndrew Pinski <pinskia@gmail.com>
Thu, 29 Jun 2006 16:28:04 +0000 (09:28 -0700)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Thu, 29 Jun 2006 16:28:04 +0000 (09:28 -0700)
2006-06-28  Andrew Pinski  <pinskia@gmail.com>

        * tree.c (tree_size): Do not waste tail padding in
        struct tree_string and make the size be the same as
        build_string will generate.

From-SVN: r115072

gcc/ChangeLog
gcc/tree.c

index 8044ed5e255a15c7e86d1ba2118ee1e576505d23..4814be31e3940b2a9f45f79ce478facb20eb6f55 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-28  Andrew Pinski  <pinskia@gmail.com>
+
+       * tree.c (tree_size): Do not waste tail padding in
+       struct tree_string and make the size be the same as
+       build_string will generate.
+
 2006-06-28  Jason Merrill  <jason@redhat.com>
 
        PR c++/27768
index e0e6716c2f6997d6bac6cf92b74f639949f9fe3f..02e7c7c68284958cea53fe247bc99584aa87e324 100644 (file)
@@ -419,7 +419,7 @@ tree_size (tree node)
              + (TREE_VEC_LENGTH (node) - 1) * sizeof(char *));
 
     case STRING_CST:
-      return sizeof (struct tree_string) + TREE_STRING_LENGTH (node) - 1;
+      return TREE_STRING_LENGTH (node) + offsetof (struct tree_string, str) + 1;
 
     case OMP_CLAUSE:
       return (sizeof (struct tree_omp_clause)