aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-06-01 20:49:18 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-06-01 20:49:18 +0000
commite6a54b01852b536ce67c8a6639adc455f36f3891 (patch)
tree83d3f1184dd0b41ae0e5c786c8add2d6cfd17d07 /gcc/tree-cfg.c
parent418dd5cefef6cd8d80de3997a0590503d653bc04 (diff)
downloadgcc-e6a54b01852b536ce67c8a6639adc455f36f3891.zip
gcc-e6a54b01852b536ce67c8a6639adc455f36f3891.tar.gz
gcc-e6a54b01852b536ce67c8a6639adc455f36f3891.tar.bz2
gimplify.c (gimplify_modify_expr_rhs): Use simple test on the size.
* gimplify.c (gimplify_modify_expr_rhs): Use simple test on the size. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Do not remove the LHS of a no-return call if its type has variable size. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * tree-cfg.c (verify_gimple_call): Accept these no-return calls. From-SVN: r223997
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 99b27c7..c53cf3e 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3391,17 +3391,19 @@ verify_gimple_call (gcall *stmt)
return true;
}
- if (gimple_call_lhs (stmt)
- && (!is_gimple_lvalue (gimple_call_lhs (stmt))
- || verify_types_in_gimple_reference (gimple_call_lhs (stmt), true)))
+ tree lhs = gimple_call_lhs (stmt);
+ if (lhs
+ && (!is_gimple_lvalue (lhs)
+ || verify_types_in_gimple_reference (lhs, true)))
{
error ("invalid LHS in gimple call");
return true;
}
- if (gimple_call_ctrl_altering_p (stmt)
- && gimple_call_lhs (stmt)
- && gimple_call_noreturn_p (stmt))
+ if (lhs
+ && gimple_call_ctrl_altering_p (stmt)
+ && gimple_call_noreturn_p (stmt)
+ && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs))) == INTEGER_CST)
{
error ("LHS in noreturn call");
return true;
@@ -3409,19 +3411,18 @@ verify_gimple_call (gcall *stmt)
fntype = gimple_call_fntype (stmt);
if (fntype
- && gimple_call_lhs (stmt)
- && !useless_type_conversion_p (TREE_TYPE (gimple_call_lhs (stmt)),
- TREE_TYPE (fntype))
+ && lhs
+ && !useless_type_conversion_p (TREE_TYPE (lhs), TREE_TYPE (fntype))
/* ??? At least C++ misses conversions at assignments from
void * call results.
??? Java is completely off. Especially with functions
returning java.lang.Object.
For now simply allow arbitrary pointer type conversions. */
- && !(POINTER_TYPE_P (TREE_TYPE (gimple_call_lhs (stmt)))
+ && !(POINTER_TYPE_P (TREE_TYPE (lhs))
&& POINTER_TYPE_P (TREE_TYPE (fntype))))
{
error ("invalid conversion in gimple call");
- debug_generic_stmt (TREE_TYPE (gimple_call_lhs (stmt)));
+ debug_generic_stmt (TREE_TYPE (lhs));
debug_generic_stmt (TREE_TYPE (fntype));
return true;
}