expr.c (get_inner_reference): Use DECL_UNSIGNED, not TREE_UNSIGNED.

* expr.c (get_inner_reference): Use DECL_UNSIGNED, not TREE_UNSIGNED.
	* stor-layout.c (layout_decl): Likewise.
	* tree.c (get_narrower): Likewise and also use BIT_FIELD_REF_UNSIGNED.
	* fold-const.c (make_bit_field_ref): Use BIT_FIELD_REF_UNSIGNED.
	* print-tree.c (print_node): Handle various used of unsigned_flag.
	* tree.def (BIT_FIELD_REF): Update comment.
	* tree.h (TREE_UNSIGNED): Deleted.
	(DECL_UNSIGNED, BIT_FIELD_REF_UNSIGNED): New macros.

	* cp/class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.

	* f/com.c (ffe_truthvalue_conversion, case COMPONENT_REF):
	Use DECL_UNSIGNED and integer_onep.

From-SVN: r80293
This commit is contained in:
Richard Kenner 2004-04-01 13:41:37 +00:00 committed by Richard Kenner
parent 0c250f07da
commit a150de2951
12 changed files with 51 additions and 19 deletions

View file

@ -1,3 +1,14 @@
2004-04-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (get_inner_reference): Use DECL_UNSIGNED, not TREE_UNSIGNED.
* stor-layout.c (layout_decl): Likewise.
* tree.c (get_narrower): Likewise and also use BIT_FIELD_REF_UNSIGNED.
* fold-const.c (make_bit_field_ref): Use BIT_FIELD_REF_UNSIGNED.
* print-tree.c (print_node): Handle various used of unsigned_flag.
* tree.def (BIT_FIELD_REF): Update comment.
* tree.h (TREE_UNSIGNED): Deleted.
(DECL_UNSIGNED, BIT_FIELD_REF_UNSIGNED): New macros.
2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c:

View file

@ -1,3 +1,7 @@
2004-04-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* class.c (VTT_TOP_LEVEL_P): Use unsigned_flag directly.
2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.

View file

@ -213,7 +213,7 @@ static tree get_vcall_index (tree, tree);
/* Macros for dfs walking during vtt construction. See
dfs_ctor_vtable_bases_queue_p, dfs_build_secondary_vptr_vtt_inits
and dfs_fixup_binfo_vtbls. */
#define VTT_TOP_LEVEL_P(NODE) TREE_UNSIGNED (NODE)
#define VTT_TOP_LEVEL_P(NODE) (TREE_LIST_CHECK (NODE)->common.unsigned_flag)
#define VTT_MARKED_BINFO_P(NODE) TREE_USED (NODE)
/* Variables shared between class.c and call.c. */

View file

@ -5440,12 +5440,12 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
if (! DECL_BIT_FIELD (TREE_OPERAND (exp, 1)))
mode = DECL_MODE (TREE_OPERAND (exp, 1));
*punsignedp = TREE_UNSIGNED (TREE_OPERAND (exp, 1));
*punsignedp = DECL_UNSIGNED (TREE_OPERAND (exp, 1));
}
else if (TREE_CODE (exp) == BIT_FIELD_REF)
{
size_tree = TREE_OPERAND (exp, 1);
*punsignedp = TREE_UNSIGNED (exp);
*punsignedp = BIT_FIELD_REF_UNSIGNED (exp);
}
else
{

View file

@ -1,3 +1,8 @@
2004-04-01 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* com.c (ffe_truthvalue_conversion, case COMPONENT_REF):
Use DECL_UNSIGNED and integer_onep.
2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED.

View file

@ -14754,8 +14754,8 @@ ffe_truthvalue_conversion (tree expr)
#if 0
case COMPONENT_REF:
/* A one-bit unsigned bit-field is already acceptable. */
if (1 == TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (expr, 1)))
&& TREE_UNSIGNED (TREE_OPERAND (expr, 1)))
if (integer_onep (DECL_SIZE (TREE_OPERAND (expr, 1)))
&& DECL_UNSIGNED (TREE_OPERAND (expr, 1)))
return expr;
break;
#endif

View file

@ -2814,7 +2814,7 @@ make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos,
tree result = build (BIT_FIELD_REF, type, inner,
size_int (bitsize), bitsize_int (bitpos));
TREE_UNSIGNED (result) = unsignedp;
BIT_FIELD_REF_UNSIGNED (result) = unsignedp;
return result;
}

View file

@ -255,8 +255,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
fputs (" addressable", file);
if (TREE_THIS_VOLATILE (node))
fputs (" volatile", file);
if (TREE_UNSIGNED (node))
fputs (" unsigned", file);
if (TREE_ASM_WRITTEN (node))
fputs (" asm_written", file);
if (TREE_USED (node))
@ -295,6 +293,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
case 'd':
mode = DECL_MODE (node);
if (DECL_UNSIGNED (node))
fputs (" unsigned", file);
if (DECL_IGNORED_P (node))
fputs (" ignored", file);
if (DECL_ABSTRACT (node))
@ -455,6 +455,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
break;
case 't':
if (TYPE_UNSIGNED (node))
fputs (" unsigned", file);
/* The no-force-blk flag is used for different things in
different types. */
if ((TREE_CODE (node) == RECORD_TYPE
@ -576,6 +579,10 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
case '2':
case 'r':
case 's':
if (TREE_CODE (node) == BIT_FIELD_REF && BIT_FIELD_REF_UNSIGNED (node))
fputs (" unsigned", file);
else if (TREE_CODE (node) == SAVE_EXPR && SAVE_EXPR_NOPLACEHOLDER (node))
fputs (" noplaceholder", file);
if (TREE_CODE (node) == BIND_EXPR)
{
print_node (file, "vars", TREE_OPERAND (node, 0), indent + 4);

View file

@ -364,7 +364,7 @@ layout_decl (tree decl, unsigned int known_align)
size in bytes from the size in bits. If we have already set the mode,
don't set it again since we can be called twice for FIELD_DECLs. */
TREE_UNSIGNED (decl) = TYPE_UNSIGNED (type);
DECL_UNSIGNED (decl) = TYPE_UNSIGNED (type);
if (DECL_MODE (decl) == VOIDmode)
DECL_MODE (decl) = TYPE_MODE (type);

View file

@ -4415,7 +4415,7 @@ get_unwidened (tree op, tree for_type)
{
unsigned int innerprec
= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
int unsignedp = (TREE_UNSIGNED (TREE_OPERAND (op, 1))
int unsignedp = (DECL_UNSIGNED (TREE_OPERAND (op, 1))
|| TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
type = lang_hooks.types.type_for_size (innerprec, unsignedp);
@ -4500,7 +4500,7 @@ get_narrower (tree op, int *unsignedp_ptr)
{
unsigned HOST_WIDE_INT innerprec
= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1);
int unsignedp = (TREE_UNSIGNED (TREE_OPERAND (op, 1))
int unsignedp = (DECL_UNSIGNED (TREE_OPERAND (op, 1))
|| TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
tree type = lang_hooks.types.type_for_size (innerprec, unsignedp);
@ -4514,11 +4514,11 @@ get_narrower (tree op, int *unsignedp_ptr)
if (innerprec < TYPE_PRECISION (TREE_TYPE (op))
&& ! DECL_BIT_FIELD (TREE_OPERAND (op, 1))
&& (first || uns == TREE_UNSIGNED (TREE_OPERAND (op, 1)))
&& (first || uns == DECL_UNSIGNED (TREE_OPERAND (op, 1)))
&& type != 0)
{
if (first)
uns = TREE_UNSIGNED (TREE_OPERAND (op, 1));
uns = DECL_UNSIGNED (TREE_OPERAND (op, 1));
win = build (COMPONENT_REF, type, TREE_OPERAND (op, 0),
TREE_OPERAND (op, 1));
TREE_SIDE_EFFECTS (win) = TREE_SIDE_EFFECTS (op);

View file

@ -365,7 +365,7 @@ DEFTREECODE (COMPONENT_REF, "component_ref", 'r', 2)
operand 1 is a tree giving the number of bits being referenced;
operand 2 is a tree giving the position of the first referenced bit.
The field can be either a signed or unsigned field;
TREE_UNSIGNED says which. */
BIT_FIELD_REF_UNSIGNED says which. */
DEFTREECODE (BIT_FIELD_REF, "bit_field_ref", 'r', 3)
/* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */

View file

@ -264,8 +264,10 @@ struct tree_common GTY(())
TYPE_UNSIGNED in
all types
TREE_UNSIGNED in
FIELD_DECL
DECL_UNSIGNED in
all decls
BIT_FIELD_REF_UNSIGNED in
BIT_FIELD_REF
SAVE_EXPR_NOPLACEHOLDER in
SAVE_EXPR
@ -710,9 +712,12 @@ extern void tree_operand_check_failed (int, enum tree_code,
if the value is constant. */
#define TREE_CONSTANT(NODE) ((NODE)->common.constant_flag)
/* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type.
In FIELD_DECL nodes, means an unsigned bit field. */
#define TREE_UNSIGNED(NODE) ((NODE)->common.unsigned_flag)
/* In a decl (most significantly a FIELD_DECL), means an unsigned field. */
#define DECL_UNSIGNED(NODE) (DECL_CHECK (NODE)->common.unsigned_flag)
/* In a BIT_FIELD_REF, means the bitfield is to be interpreted as unsigned. */
#define BIT_FIELD_REF_UNSIGNED(NODE) \
(BIT_FIELD_REF_CHECK (NODE)->common.unsigned_flag)
/* In integral and pointer types, means an unsigned type. */
#define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.unsigned_flag)