+2000-02-23 Zack Weinberg <zack@wolery.cumb.org>
+
+ * tree.h (TREE_SET_PERMANENT): New macro. Document conditions
+ under which TREE_PERMANENT will be set.
+ * tree.c (make_node, copy_node, make_tree_vec, tree_cons,
+ build1): Use TREE_SET_PERMANENT.
+ * print-tree.c (print_node): Don't report value of
+ TREE_PERMANENT if ggc_p is true.
+
+ * c-common.c (c_get_alias_set): Don't use TREE_PERMANENT to
+ decide whether to give a type a new alias set.
+ * objc/objc-act.c (build_objc_string_object): Never copy the string.
+ * tree.c (make_node): Set DECL_IN_SYSTEM_HEADER irrespective
+ of value of 'obstack'.
+
+
2000-02-24 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.c (c4x_process_after_reload): Split all insns.
}
if (!TYPE_ALIAS_SET_KNOWN_P (type))
- {
- /* Types that are not global ('permanent') are not
- placed in the type hash table. Thus, there can be multiple
- copies of identical types in local scopes. In the long run,
- all types should be permanent. */
- if (! TREE_PERMANENT (type))
- TYPE_ALIAS_SET (type) = 0;
- else
- /* TYPE is something we haven't seen before. Put it in a new
- alias set. */
- TYPE_ALIAS_SET (type) = new_alias_set ();
- }
+ /* TYPE is something we haven't seen before. Put it in a new
+ alias set. */
+ TYPE_ALIAS_SET (type) = new_alias_set ();
return TYPE_ALIAS_SET (type);
}
+2000-02-23 Zack Weinberg <zack@wolery.cumb.org>
+
+ * com.c (ffecom_type_permanent_copy_): Delete unused function.
+ (finish_decl): Don't change TREE_PERMANENT (DECL_INITIAL (decl)).
+
Sat Feb 19 18:43:13 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* com.c (ffecom_sym_transform): Use DECL_SIZE_UNIT.
ffeinfoBasictype bt,
ffeinfoKindtype kt);
static tree ffecom_type_namelist_ (void);
-#if 0
-static tree ffecom_type_permanent_copy_ (tree t);
-#endif
static tree ffecom_type_vardesc_ (void);
static tree ffecom_vardesc_ (ffebld expr);
static tree ffecom_vardesc_array_ (ffesymbol s);
#endif
-/* Make a copy of a type, assuming caller has switched to the permanent
- obstacks and that the type is for an aggregate (array) initializer. */
-
-#if FFECOM_targetCURRENT == FFECOM_targetGCC && 0 /* Not used now. */
-static tree
-ffecom_type_permanent_copy_ (tree t)
-{
- tree domain;
- tree max;
-
- assert (TREE_TYPE (t) != NULL_TREE);
-
- domain = TYPE_DOMAIN (t);
-
- assert (TREE_CODE (t) == ARRAY_TYPE);
- assert (TREE_PERMANENT (TREE_TYPE (t)));
- assert (TREE_PERMANENT (TREE_TYPE (domain)));
- assert (TREE_PERMANENT (TYPE_MIN_VALUE (domain)));
-
- max = TYPE_MAX_VALUE (domain);
- if (!TREE_PERMANENT (max))
- {
- assert (TREE_CODE (max) == INTEGER_CST);
-
- max = build_int_2 (TREE_INT_CST_LOW (max), TREE_INT_CST_HIGH (max));
- TREE_TYPE (max) = TREE_TYPE (TYPE_MIN_VALUE (domain));
- }
-
- return build_array_type (TREE_TYPE (t),
- build_range_type (TREE_TYPE (domain),
- TYPE_MIN_VALUE (domain),
- max));
-}
-#endif
-
/* Build Vardesc type. */
#if FFECOM_targetCURRENT == FFECOM_targetGCC
0);
}
- /* This test used to include TREE_PERMANENT, however, we have the same
- problem with initializers at the function level. Such initializers get
- saved until the end of the function on the momentary_obstack. */
if (!(TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl))
&& temporary
/* DECL_INITIAL is not defined in PARM_DECLs, since it shares space with
if (TREE_READONLY (decl))
{
preserve_initializer ();
- /* Hack? Set the permanent bit for something that is
- permanent, but not on the permenent obstack, so as to
- convince output_constant_def to make its rtl on the
- permanent obstack. */
- TREE_PERMANENT (DECL_INITIAL (decl)) = 1;
/* The initializer and DECL must have the same (or equivalent
types), but if the initializer is a STRING_CST, its type
TREE_SET_CODE (string, STRING_CST);
length = TREE_STRING_LENGTH (string) - 1;
- if (! flag_next_runtime)
- {
- if (! TREE_PERMANENT (strings))
- string = my_build_string (length + 1,
- TREE_STRING_POINTER (string));
- }
-
/* & ((NXConstantString) {0, string, length}) */
initlist = build_tree_list (NULL_TREE, build_int_2 (0, 0));
fputs (" used", file);
if (TREE_RAISES (node))
fputs (" raises", file);
- if (TREE_PERMANENT (node))
+ if (!ggc_p && TREE_PERMANENT (node))
fputs (" permanent", file);
if (TREE_PUBLIC (node))
fputs (" public", file);
/* Return a newly allocated node of code CODE.
Initialize the node's unique id and its TREE_PERMANENT flag.
+ Note that if garbage collection is in use, TREE_PERMANENT will
+ always be zero - we want to eliminate use of TREE_PERMANENT.
For decl and type nodes, some other fields are initialized.
The rest of the node is initialized to zero.
#endif
TREE_SET_CODE (t, code);
- if (obstack == &permanent_obstack)
- TREE_PERMANENT (t) = 1;
+ TREE_SET_PERMANENT (t);
switch (type)
{
case 'd':
if (code != FUNCTION_DECL)
DECL_ALIGN (t) = 1;
- DECL_IN_SYSTEM_HEADER (t)
- = in_system_header && (obstack == &permanent_obstack);
+ DECL_IN_SYSTEM_HEADER (t) = in_system_header;
DECL_SOURCE_LINE (t) = lineno;
DECL_SOURCE_FILE (t) =
(input_filename) ? input_filename : built_in_filename;
TYPE_SYMTAB_ADDRESS (t) = 0;
}
- TREE_PERMANENT (t) = (current_obstack == &permanent_obstack);
+ TREE_SET_PERMANENT (t);
return t;
}
TREE_SET_CODE (t, TREE_VEC);
TREE_VEC_LENGTH (t) = len;
- if (obstack == &permanent_obstack)
- TREE_PERMANENT (t) = 1;
+ TREE_SET_PERMANENT (t);
return t;
}
tree_node_sizes[(int)x_kind] += sizeof (struct tree_list);
#endif
-
TREE_SET_CODE (node, TREE_LIST);
- if (current_obstack == &permanent_obstack)
- TREE_PERMANENT (node) = 1;
+ TREE_SET_PERMANENT (node);
TREE_CHAIN (node) = chain;
TREE_PURPOSE (node) = purpose;
TREE_TYPE (t) = type;
TREE_SET_CODE (t, code);
-
- if (obstack == &permanent_obstack)
- TREE_PERMANENT (t) = 1;
+ TREE_SET_PERMANENT (t);
TREE_OPERAND (t, 0) = node;
if (node && first_rtl_op (code) != 0)
/* Nonzero means permanent node;
node will continue to exist for the entire compiler run.
- Otherwise it will be recycled at the end of the function. */
+ Otherwise it will be recycled at the end of the function.
+ This flag is always zero if garbage collection is in use.
+ Try not to use this. Only set it with TREE_SET_PERMANENT. */
#define TREE_PERMANENT(NODE) ((NODE)->common.permanent_flag)
+#define TREE_SET_PERMANENT(NODE) do { \
+ if (!ggc_p && current_obstack == &permanent_obstack) \
+ TREE_PERMANENT(NODE) = 1; \
+} while (0)
/* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type.
In FIELD_DECL nodes, means an unsigned bit field.