Commit a150de29 by Richard Kenner Committed by Richard Kenner

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
parent 0c250f07
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> 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: * builtins.c, c-aux-info.c, c-common.c, c-cppbuiltin.c, c-decl.c:
......
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> 2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED. * call.c (joust): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
......
...@@ -213,7 +213,7 @@ static tree get_vcall_index (tree, tree); ...@@ -213,7 +213,7 @@ static tree get_vcall_index (tree, tree);
/* Macros for dfs walking during vtt construction. See /* Macros for dfs walking during vtt construction. See
dfs_ctor_vtable_bases_queue_p, dfs_build_secondary_vptr_vtt_inits dfs_ctor_vtable_bases_queue_p, dfs_build_secondary_vptr_vtt_inits
and dfs_fixup_binfo_vtbls. */ 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) #define VTT_MARKED_BINFO_P(NODE) TREE_USED (NODE)
/* Variables shared between class.c and call.c. */ /* Variables shared between class.c and call.c. */
......
...@@ -5440,12 +5440,12 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize, ...@@ -5440,12 +5440,12 @@ get_inner_reference (tree exp, HOST_WIDE_INT *pbitsize,
if (! DECL_BIT_FIELD (TREE_OPERAND (exp, 1))) if (! DECL_BIT_FIELD (TREE_OPERAND (exp, 1)))
mode = DECL_MODE (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) else if (TREE_CODE (exp) == BIT_FIELD_REF)
{ {
size_tree = TREE_OPERAND (exp, 1); size_tree = TREE_OPERAND (exp, 1);
*punsignedp = TREE_UNSIGNED (exp); *punsignedp = BIT_FIELD_REF_UNSIGNED (exp);
} }
else else
{ {
......
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> 2004-03-31 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED. * com.c (ffecom_arrayref_): Use TYPE_UNSIGNED, not TREE_UNSIGNED.
......
...@@ -14754,8 +14754,8 @@ ffe_truthvalue_conversion (tree expr) ...@@ -14754,8 +14754,8 @@ ffe_truthvalue_conversion (tree expr)
#if 0 #if 0
case COMPONENT_REF: case COMPONENT_REF:
/* A one-bit unsigned bit-field is already acceptable. */ /* A one-bit unsigned bit-field is already acceptable. */
if (1 == TREE_INT_CST_LOW (DECL_SIZE (TREE_OPERAND (expr, 1))) if (integer_onep (DECL_SIZE (TREE_OPERAND (expr, 1)))
&& TREE_UNSIGNED (TREE_OPERAND (expr, 1))) && DECL_UNSIGNED (TREE_OPERAND (expr, 1)))
return expr; return expr;
break; break;
#endif #endif
......
...@@ -2814,7 +2814,7 @@ make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos, ...@@ -2814,7 +2814,7 @@ make_bit_field_ref (tree inner, tree type, int bitsize, int bitpos,
tree result = build (BIT_FIELD_REF, type, inner, tree result = build (BIT_FIELD_REF, type, inner,
size_int (bitsize), bitsize_int (bitpos)); size_int (bitsize), bitsize_int (bitpos));
TREE_UNSIGNED (result) = unsignedp; BIT_FIELD_REF_UNSIGNED (result) = unsignedp;
return result; return result;
} }
......
...@@ -255,8 +255,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent) ...@@ -255,8 +255,6 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
fputs (" addressable", file); fputs (" addressable", file);
if (TREE_THIS_VOLATILE (node)) if (TREE_THIS_VOLATILE (node))
fputs (" volatile", file); fputs (" volatile", file);
if (TREE_UNSIGNED (node))
fputs (" unsigned", file);
if (TREE_ASM_WRITTEN (node)) if (TREE_ASM_WRITTEN (node))
fputs (" asm_written", file); fputs (" asm_written", file);
if (TREE_USED (node)) if (TREE_USED (node))
...@@ -295,6 +293,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent) ...@@ -295,6 +293,8 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
case 'd': case 'd':
mode = DECL_MODE (node); mode = DECL_MODE (node);
if (DECL_UNSIGNED (node))
fputs (" unsigned", file);
if (DECL_IGNORED_P (node)) if (DECL_IGNORED_P (node))
fputs (" ignored", file); fputs (" ignored", file);
if (DECL_ABSTRACT (node)) if (DECL_ABSTRACT (node))
...@@ -455,6 +455,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent) ...@@ -455,6 +455,9 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
break; break;
case 't': case 't':
if (TYPE_UNSIGNED (node))
fputs (" unsigned", file);
/* The no-force-blk flag is used for different things in /* The no-force-blk flag is used for different things in
different types. */ different types. */
if ((TREE_CODE (node) == RECORD_TYPE if ((TREE_CODE (node) == RECORD_TYPE
...@@ -576,6 +579,10 @@ print_node (FILE *file, const char *prefix, tree node, int indent) ...@@ -576,6 +579,10 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
case '2': case '2':
case 'r': case 'r':
case 's': 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) if (TREE_CODE (node) == BIND_EXPR)
{ {
print_node (file, "vars", TREE_OPERAND (node, 0), indent + 4); print_node (file, "vars", TREE_OPERAND (node, 0), indent + 4);
......
...@@ -364,7 +364,7 @@ layout_decl (tree decl, unsigned int known_align) ...@@ -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, 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. */ 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) if (DECL_MODE (decl) == VOIDmode)
DECL_MODE (decl) = TYPE_MODE (type); DECL_MODE (decl) = TYPE_MODE (type);
......
...@@ -4415,7 +4415,7 @@ get_unwidened (tree op, tree for_type) ...@@ -4415,7 +4415,7 @@ get_unwidened (tree op, tree for_type)
{ {
unsigned int innerprec unsigned int innerprec
= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1); = 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_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
type = lang_hooks.types.type_for_size (innerprec, unsignedp); type = lang_hooks.types.type_for_size (innerprec, unsignedp);
...@@ -4500,7 +4500,7 @@ get_narrower (tree op, int *unsignedp_ptr) ...@@ -4500,7 +4500,7 @@ get_narrower (tree op, int *unsignedp_ptr)
{ {
unsigned HOST_WIDE_INT innerprec unsigned HOST_WIDE_INT innerprec
= tree_low_cst (DECL_SIZE (TREE_OPERAND (op, 1)), 1); = 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_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 1))));
tree type = lang_hooks.types.type_for_size (innerprec, unsignedp); tree type = lang_hooks.types.type_for_size (innerprec, unsignedp);
...@@ -4514,11 +4514,11 @@ get_narrower (tree op, int *unsignedp_ptr) ...@@ -4514,11 +4514,11 @@ get_narrower (tree op, int *unsignedp_ptr)
if (innerprec < TYPE_PRECISION (TREE_TYPE (op)) if (innerprec < TYPE_PRECISION (TREE_TYPE (op))
&& ! DECL_BIT_FIELD (TREE_OPERAND (op, 1)) && ! 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) && type != 0)
{ {
if (first) 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), win = build (COMPONENT_REF, type, TREE_OPERAND (op, 0),
TREE_OPERAND (op, 1)); TREE_OPERAND (op, 1));
TREE_SIDE_EFFECTS (win) = TREE_SIDE_EFFECTS (op); TREE_SIDE_EFFECTS (win) = TREE_SIDE_EFFECTS (op);
......
...@@ -365,7 +365,7 @@ DEFTREECODE (COMPONENT_REF, "component_ref", 'r', 2) ...@@ -365,7 +365,7 @@ DEFTREECODE (COMPONENT_REF, "component_ref", 'r', 2)
operand 1 is a tree giving the number of bits being referenced; 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. operand 2 is a tree giving the position of the first referenced bit.
The field can be either a signed or unsigned field; 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) DEFTREECODE (BIT_FIELD_REF, "bit_field_ref", 'r', 3)
/* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */ /* C unary `*' or Pascal `^'. One operand, an expression for a pointer. */
......
...@@ -264,8 +264,10 @@ struct tree_common GTY(()) ...@@ -264,8 +264,10 @@ struct tree_common GTY(())
TYPE_UNSIGNED in TYPE_UNSIGNED in
all types all types
TREE_UNSIGNED in DECL_UNSIGNED in
FIELD_DECL all decls
BIT_FIELD_REF_UNSIGNED in
BIT_FIELD_REF
SAVE_EXPR_NOPLACEHOLDER in SAVE_EXPR_NOPLACEHOLDER in
SAVE_EXPR SAVE_EXPR
...@@ -710,9 +712,12 @@ extern void tree_operand_check_failed (int, enum tree_code, ...@@ -710,9 +712,12 @@ extern void tree_operand_check_failed (int, enum tree_code,
if the value is constant. */ if the value is constant. */
#define TREE_CONSTANT(NODE) ((NODE)->common.constant_flag) #define TREE_CONSTANT(NODE) ((NODE)->common.constant_flag)
/* In INTEGER_TYPE or ENUMERAL_TYPE nodes, means an unsigned type. /* In a decl (most significantly a FIELD_DECL), means an unsigned field. */
In FIELD_DECL nodes, means an unsigned bit field. */ #define DECL_UNSIGNED(NODE) (DECL_CHECK (NODE)->common.unsigned_flag)
#define TREE_UNSIGNED(NODE) ((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. */ /* In integral and pointer types, means an unsigned type. */
#define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.unsigned_flag) #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->common.unsigned_flag)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment