summaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-21 23:05:13 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2009-11-21 23:05:13 +0000
commit66b8b09f004267afd74e2317af2f09f7b81072e4 (patch)
treeb55fd9a863af58a8fc1d323d3298bc4d7f6e8df6 /gcc/tree-cfg.c
parent7dea2474ca67c1fb3239092e4d90a8bb254df6b9 (diff)
downloadgcc-66b8b09f004267afd74e2317af2f09f7b81072e4.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154414 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index b3b71b9abba..13aa63f1d59 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -2889,12 +2889,24 @@ verify_types_in_gimple_reference (tree expr, bool require_lvalue)
return true;
}
- /* For VIEW_CONVERT_EXPRs which are allowed here, too, there
- is nothing to verify. Gross mismatches at most invoke
- undefined behavior. */
- if (TREE_CODE (expr) == VIEW_CONVERT_EXPR
- && !handled_component_p (op))
- return false;
+ if (TREE_CODE (expr) == VIEW_CONVERT_EXPR)
+ {
+ /* For VIEW_CONVERT_EXPRs which are allowed here too, we only check
+ that their operand is not an SSA name or an invariant when
+ requiring an lvalue (this usually means there is a SRA or IPA-SRA
+ 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;
}
@@ -2951,7 +2963,8 @@ verify_gimple_call (gimple 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");
return true;