Commit e55f42fb by Richard Guenther Committed by Richard Biener

re PR c++/35336 (Broken diagnostic: 'bit_field_ref' not supported by dump_expr)

2008-03-05  Richard Guenther  <rguenther@suse.de>

	PR c++/35336
	* tree.def (BIT_FIELD_REF): Document that operands 1 and 2
	should be constants.
	* tree-cfg.c (verify_expr): Verify it.
	* fold-const.c (fold_truthop): Remove code generating
	BIT_FIELD_REFs of structure bases.
	(fold_binary): Likewise.
	(fold_ternary): Position and size of BIT_FIELD_REFs are
	always host integers.
	(make_bit_field_ref): Remove.
	(optimize_bit_field_compare): Remove.
	(all_ones_mask_p): Remove.

From-SVN: r132894
parent 1da266fe
2008-03-05 Richard Guenther <rguenther@suse.de>
PR c++/35336
* tree.def (BIT_FIELD_REF): Document that operands 1 and 2
should be constants.
* tree-cfg.c (verify_expr): Verify it.
* fold-const.c (fold_truthop): Remove code generating
BIT_FIELD_REFs of structure bases.
(fold_binary): Likewise.
(fold_ternary): Position and size of BIT_FIELD_REFs are
always host integers.
(make_bit_field_ref): Remove.
(optimize_bit_field_compare): Remove.
(all_ones_mask_p): Remove.
2008-03-05 Gabor Loki <loki@gcc.gnu.org>
PR gcc/33009
......
......@@ -3267,8 +3267,12 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
}
else if (TREE_CODE (t) == BIT_FIELD_REF)
{
CHECK_OP (1, "invalid operand to BIT_FIELD_REF");
CHECK_OP (2, "invalid operand to BIT_FIELD_REF");
if (!host_integerp (TREE_OPERAND (t, 1), 1)
|| !host_integerp (TREE_OPERAND (t, 2), 1))
{
error ("invalid position or size operand to BIT_FIELD_REF");
return t;
}
}
t = TREE_OPERAND (t, 0);
......
......@@ -389,8 +389,8 @@ DEFTREECODE (COMPONENT_REF, "component_ref", tcc_reference, 3)
/* Reference to a group of bits within an object. Similar to COMPONENT_REF
except the position is given explicitly rather than via a FIELD_DECL.
Operand 0 is the structure or union expression;
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 1 is a tree giving the constant number of bits being referenced;
operand 2 is a tree giving the constant position of the first referenced bit.
The field can be either a signed or unsigned field;
BIT_FIELD_REF_UNSIGNED says which. */
DEFTREECODE (BIT_FIELD_REF, "bit_field_ref", tcc_reference, 3)
......
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