Commit cc12e760 by Martin Jambor Committed by Martin Jambor

tree-cfg.c (verify_types_in_gimple_reference): Error out on V_C_E of an SSA_NAME…

tree-cfg.c (verify_types_in_gimple_reference): Error out on V_C_E of an SSA_NAME or an invariant if lvalue is required.

2009-11-22  Martin Jambor  <mjambor@suse.cz>

	* tree-cfg.c (verify_types_in_gimple_reference): Error out on
	V_C_E of an SSA_NAME or an invariant if lvalue is required.
	(verify_gimple_call): Verify LHS also with with
	verify_types_in_gimple_reference.

From-SVN: r154414
parent c6a2c25d
2009-11-22 Martin Jambor <mjambor@suse.cz>
* tree-cfg.c (verify_types_in_gimple_reference): Error out on
V_C_E of an SSA_NAME or an invariant if lvalue is required.
(verify_gimple_call): Verify LHS also with with
verify_types_in_gimple_reference.
2009-11-21 Martin Jambor <mjambor@suse.cz> 2009-11-21 Martin Jambor <mjambor@suse.cz>
PR middle-end/42025 PR middle-end/42025
...@@ -2889,12 +2889,24 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue) ...@@ -2889,12 +2889,24 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
return true; return true;
} }
/* For VIEW_CONVERT_EXPRs which are allowed here, too, there if (TREE_CODE (expr) == VIEW_CONVERT_EXPR)
is nothing to verify. Gross mismatches at most invoke {
undefined behavior. */ /* For VIEW_CONVERT_EXPRs which are allowed here too, we only check
if (TREE_CODE (expr) == VIEW_CONVERT_EXPR that their operand is not an SSA name or an invariant when
&& !handled_component_p (op)) requiring an lvalue (this usually means there is a SRA or IPA-SRA
return false; bug). Otherwise there is nothing to verify, gross mismatches at
most invoke undefined behavior. */
if (require_lvalue
&& (TREE_CODE (op) == SSA_NAME
|| is_gimple_min_invariant (op)))
{
error ("Conversion of an SSA_NAME on the left hand side.");
debug_generic_stmt (expr);
return true;
}
else if (!handled_component_p (op))
return false;
}
expr = op; expr = op;
} }
...@@ -2951,7 +2963,8 @@ verify_gimple_call (gimple stmt) ...@@ -2951,7 +2963,8 @@ verify_gimple_call (gimple stmt)
} }
if (gimple_call_lhs (stmt) if (gimple_call_lhs (stmt)
&& !is_gimple_lvalue (gimple_call_lhs (stmt))) && (!is_gimple_lvalue (gimple_call_lhs (stmt))
|| verify_types_in_gimple_reference (gimple_call_lhs (stmt), true)))
{ {
error ("invalid LHS in gimple call"); error ("invalid LHS in gimple call");
return true; return true;
......
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