aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorRainer Orth <ro@gcc.gnu.org>2004-02-05 21:56:38 +0000
committerRainer Orth <ro@gcc.gnu.org>2004-02-05 21:56:38 +0000
commit839ee4bc570bf56df913d37a4fa3ab9fb6e5956e (patch)
treefea6753c45927b3c5f949fb0dae2037d0d80e885 /gcc/tree.c
parent687d688ee40cff3395a34c7dacab54550f7de606 (diff)
downloadgcc-839ee4bc570bf56df913d37a4fa3ab9fb6e5956e.zip
gcc-839ee4bc570bf56df913d37a4fa3ab9fb6e5956e.tar.gz
gcc-839ee4bc570bf56df913d37a4fa3ab9fb6e5956e.tar.bz2
re PR target/13750 (Ada bootstrap failure on Tru64 UNIX: b_gnat[1b].o comparison failure)
PR middle-end/13750 Revert: 2004-01-15 Geoffrey Keating <geoffk@apple.com> PR pch/13361 * c-typeck.c (constructor_asmspec): Delete. (struct initializer_stack): Delete field 'asmspec'. (start_init): Delete saving of asmspec. (finish_init): Don't update constructor_asmspec. * dwarf2out.c (rtl_for_decl_location): Duplicate string from tree. * stmt.c (expand_asm): Duplicate strings from tree. (expand_asm_operands): Likewise. * tree.c (tree_size): Update computation of size of STRING_CST. (make_node): Don't make STRING_CST nodes. (build_string): Allocate string with tree node. * tree.def (STRING_CST): Update comment. * tree.h (TREE_STRING_POINTER): Adjust for change to STRING_CST. (tree_string): Place contents of string in tree node. * config/sh/sh.c (sh_handle_sp_switch_attribute): Duplicate string from tree. cp: PR middle-end/13750 Revert: 2004-01-15 Geoffrey Keating <geoffk@apple.com> PR pch/13361 * cp/lex.c (handle_pragma_interface): Duplicate string from tree. (handle_pragma_implementation): Likewise. testsuite: PR middle-end/13750 Revert: 2004-01-15 Geoffrey Keating <geoffk@apple.com> PR pch/13361 * testsuite/g++.dg/pch/wchar-1.C: New. * testsuite/g++.dg/pch/wchar-1.Hs: New. From-SVN: r77343
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index ac0da20..12eabd9 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -168,8 +168,7 @@ tree_size (tree node)
case REAL_CST: return sizeof (struct tree_real_cst);
case COMPLEX_CST: return sizeof (struct tree_complex);
case VECTOR_CST: return sizeof (struct tree_vector);
- case STRING_CST:
- return sizeof (struct tree_string) + TREE_STRING_LENGTH (node);
+ case STRING_CST: return sizeof (struct tree_string);
default:
return (*lang_hooks.tree_size) (code);
}
@@ -213,8 +212,8 @@ make_node (enum tree_code code)
struct tree_common ttmp;
/* We can't allocate a TREE_VEC without knowing how many elements
- it will have; likewise a STRING_CST without knowing the length. */
- if (code == TREE_VEC || code == STRING_CST)
+ it will have. */
+ if (code == TREE_VEC)
abort ();
TREE_SET_CODE ((tree)&ttmp, code);
@@ -526,23 +525,10 @@ build_real_from_int_cst (tree type, tree i)
tree
build_string (int len, const char *str)
{
- tree s;
- size_t length;
-
- length = len + sizeof (struct tree_string);
-
-#ifdef GATHER_STATISTICS
- tree_node_counts[(int) c_kind]++;
- tree_node_sizes[(int) c_kind] += length;
-#endif
-
- s = ggc_alloc_tree (length);
+ tree s = make_node (STRING_CST);
- memset (s, 0, sizeof (struct tree_common));
- TREE_SET_CODE (s, STRING_CST);
TREE_STRING_LENGTH (s) = len;
- memcpy ((char *) TREE_STRING_POINTER (s), str, len);
- ((char *) TREE_STRING_POINTER (s))[len] = '\0';
+ TREE_STRING_POINTER (s) = ggc_alloc_string (str, len);
return s;
}