From 89b0433e3a1f0a9ae590c1be5a6ba4b9aa690ae0 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Thu, 19 Aug 2004 10:36:07 +0000 Subject: tree.h (TYPE_CACHED_VALUES_P): New. * tree.h (TYPE_CACHED_VALUES_P): New. (TYPE_CACHED_VALUES): New. (TYPE_ORIG_SIZE_TYPE): Adjust. * tree.def (INTEGER_CST): Update documentation. * tree.c: Inlcude params.h. (build_int_cst): Cache small values. (build_type_copy): Do not copy the value cache. * c-common.c (c_common_nodes_and_builtins): Add comment, remove unneeded zeroing. * c-typeck.c (build_c_cast): Add comment about OVERFLOW setting. * expmed.c (const_mult_add_overflow_p): Clear type copy's value cache. * fold-const.c (force_fit_type): Copy value when setting overflows. (int_const_binop): Likewise. * stor-layout.c: Include params.h (set_sizetype): Create values cache. (fixup_unsigned_type): Set UNSIGNED_P before caching any values. * params.def (PARAM_INTEGER_SHARE_LIMIT): New. * params.h (INTEGER_SHARE_LIMIT): New. * Makefile.in (tree.o, stor-layout.o): Depend on PARAMS_H. * cp/decl.c (finish_enum): Do not copy value node early, copy later. * cp/lex.c (cxx_init): Force null_node to be unique. * java/parse.h (JAVA_RADIX10_FLAG): Rename to ... (JAVA_NOT_RADIX10_FLAG): ... here. Invert meaning. * java/lex.c (do_java_lex): Adjust. (error_if_numeric_overflow): Likewise. From-SVN: r86247 --- gcc/tree.def | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gcc/tree.def') diff --git a/gcc/tree.def b/gcc/tree.def index 552be88..fc7ed81 100644 --- a/gcc/tree.def +++ b/gcc/tree.def @@ -258,10 +258,13 @@ DEFTREECODE (LANG_TYPE, "lang_type", 't', 0) /* First, the constants. */ /* Contents are in TREE_INT_CST_LOW and TREE_INT_CST_HIGH fields, - 32 bits each, giving us a 64 bit constant capability. - Note: constants of type char in Pascal are INTEGER_CST, - and so are pointer constants such as nil in Pascal or NULL in C. - `(int *) 1' in C also results in an INTEGER_CST. */ + 32 bits each, giving us a 64 bit constant capability. INTEGER_CST + nodes can be shared, and therefore should be considered read only. + They should be copied, before setting a flag such as + TREE_OVERFLOW. If an INTEGER_CST has TREE_OVERFLOW or + TREE_CONSTANT_OVERFLOW already set, it is known to be unique. + INTEGER_CST nodes are created for the integral types, for pointer + types and for vector and float types in some circumstances. */ DEFTREECODE (INTEGER_CST, "integer_cst", 'c', 0) /* Contents are in TREE_REAL_CST field. */ -- cgit v1.1