* 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
+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:
+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.
/* 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. */
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
{
+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.
#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
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;
}
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))
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))
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
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);
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);
{
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);
{
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);
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);
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. */
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
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)