aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-07-18 11:16:07 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-07-18 11:16:07 +0000
commit33922890f647d590f0450638c03ff1673022b662 (patch)
tree0a5d4bea47812ee107c666286ff567e90ad089ca /gcc/gimplify.c
parent1d4479957bdda8182a8a442afa53fef543984c56 (diff)
downloadgcc-33922890f647d590f0450638c03ff1673022b662.zip
gcc-33922890f647d590f0450638c03ff1673022b662.tar.gz
gcc-33922890f647d590f0450638c03ff1673022b662.tar.bz2
re PR c/40787 (ICE: verify_gimple failed in gcc.dg/pr35899.c)
2009-07-18 Richard Guenther <rguenther@suse.de> PR c/40787 * gimplify.c (gimplify_call_expr): Reject code using results from functions returning void. * gcc.dg/pr35899.c: Adjust. From-SVN: r149770
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 884d00f..dc8d0c0 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -2411,6 +2411,14 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value)
}
}
+ /* Verify the function result. */
+ if (want_value && fndecl
+ && VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fndecl))))
+ {
+ error_at (loc, "using result of function returning %<void%>");
+ ret = GS_ERROR;
+ }
+
/* Try this again in case gimplification exposed something. */
if (ret != GS_ERROR)
{