aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1994-12-21 12:50:57 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1994-12-21 12:50:57 -0500
commitb6ec8c5f7538fb75c01dc5e126bf69118e88ec91 (patch)
tree99f84544d0e3578340d98d6050d1a1fb5b80ddeb
parente24b00c81a1fe3e5031393e337b679aec706432c (diff)
downloadgcc-b6ec8c5f7538fb75c01dc5e126bf69118e88ec91.zip
gcc-b6ec8c5f7538fb75c01dc5e126bf69118e88ec91.tar.gz
gcc-b6ec8c5f7538fb75c01dc5e126bf69118e88ec91.tar.bz2
(expand_expr_stmt): If want values for statements, convert function to
address-of-function. From-SVN: r8679
-rw-r--r--gcc/stmt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 1ebf1a7..4d3ed87 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1621,6 +1621,12 @@ expand_expr_stmt (exp)
else if (warn_unused)
warn_if_unused_value (exp);
}
+
+ /* If EXP is of function type and we are expanding statements for
+ value, convert it to pointer-to-function. */
+ if (expr_stmts_for_value && TREE_CODE (TREE_TYPE (exp)) == FUNCTION_TYPE)
+ exp = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (exp)), exp);
+
last_expr_type = TREE_TYPE (exp);
if (! flag_syntax_only)
last_expr_value = expand_expr (exp,