Commit d20188f3 by Martin Jambor Committed by Martin Jambor

tree-cfg.c (verify_expr): Verify that BIT_FIELD_REF...

2013-05-29  Martin Jambor  <mjambor@suse.cz>

	* tree-cfg.c (verify_expr): Verify that BIT_FIELD_REF, REALPART_EXPR
	and IMAGPART_EXPR do not occur within other handled_components.

From-SVN: r199405
parent 292cba13
2013-05-29 Martin Jambor <mjambor@suse.cz>
* tree-cfg.c (verify_expr): Verify that BIT_FIELD_REF, REALPART_EXPR
and IMAGPART_EXPR do not occur within other handled_components.
2013-05-29 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_bb_slp_scalar_cost): Guard vinfo
......
......@@ -2675,29 +2675,7 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
return t;
}
/* Fall-through. */
case COMPONENT_REF:
case ARRAY_REF:
case ARRAY_RANGE_REF:
case VIEW_CONVERT_EXPR:
/* We have a nest of references. Verify that each of the operands
that determine where to reference is either a constant or a variable,
verify that the base is valid, and then show we've already checked
the subtrees. */
while (handled_component_p (t))
{
if (TREE_CODE (t) == COMPONENT_REF && TREE_OPERAND (t, 2))
CHECK_OP (2, "invalid COMPONENT_REF offset operator");
else if (TREE_CODE (t) == ARRAY_REF
|| TREE_CODE (t) == ARRAY_RANGE_REF)
{
CHECK_OP (1, "invalid array index");
if (TREE_OPERAND (t, 2))
CHECK_OP (2, "invalid array lower bound");
if (TREE_OPERAND (t, 3))
CHECK_OP (3, "invalid array stride");
}
else if (TREE_CODE (t) == BIT_FIELD_REF)
if (TREE_CODE (t) == BIT_FIELD_REF)
{
if (!host_integerp (TREE_OPERAND (t, 1), 1)
|| !host_integerp (TREE_OPERAND (t, 2), 1))
......@@ -2714,7 +2692,6 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
return t;
}
else if (!INTEGRAL_TYPE_P (TREE_TYPE (t))
&& !AGGREGATE_TYPE_P (TREE_TYPE (t))
&& TYPE_MODE (TREE_TYPE (t)) != BLKmode
&& (GET_MODE_PRECISION (TYPE_MODE (TREE_TYPE (t)))
!= TREE_INT_CST_LOW (TREE_OPERAND (t, 1))))
......@@ -2724,6 +2701,38 @@ verify_expr (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED)
return t;
}
}
t = TREE_OPERAND (t, 0);
/* Fall-through. */
case COMPONENT_REF:
case ARRAY_REF:
case ARRAY_RANGE_REF:
case VIEW_CONVERT_EXPR:
/* We have a nest of references. Verify that each of the operands
that determine where to reference is either a constant or a variable,
verify that the base is valid, and then show we've already checked
the subtrees. */
while (handled_component_p (t))
{
if (TREE_CODE (t) == COMPONENT_REF && TREE_OPERAND (t, 2))
CHECK_OP (2, "invalid COMPONENT_REF offset operator");
else if (TREE_CODE (t) == ARRAY_REF
|| TREE_CODE (t) == ARRAY_RANGE_REF)
{
CHECK_OP (1, "invalid array index");
if (TREE_OPERAND (t, 2))
CHECK_OP (2, "invalid array lower bound");
if (TREE_OPERAND (t, 3))
CHECK_OP (3, "invalid array stride");
}
else if (TREE_CODE (t) == BIT_FIELD_REF
|| TREE_CODE (t) == REALPART_EXPR
|| TREE_CODE (t) == IMAGPART_EXPR)
{
error ("non-top-level BIT_FIELD_REF, IMAGPART_EXPR or "
"REALPART_EXPR");
return t;
}
t = TREE_OPERAND (t, 0);
}
......
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