aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index c420863..9f0774f 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -3374,6 +3374,13 @@ cgraph_node::verify_node (void)
error ("calls_comdat_local is set outside of a comdat group");
error_found = true;
}
+ if (DECL_IS_MALLOC (decl)
+ && !POINTER_TYPE_P (TREE_TYPE (TREE_TYPE (decl))))
+ {
+ error ("malloc attribute should be used for a function that "
+ "returns a pointer");
+ error_found = true;
+ }
for (e = indirect_calls; e; e = e->next_callee)
{
if (e->aux)