From: Richard Kenner Date: Wed, 21 Dec 1994 17:50:57 +0000 (-0500) Subject: (expand_expr_stmt): If want values for statements, convert function to X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b6ec8c5f7538fb75c01dc5e126bf69118e88ec91;p=gcc.git (expand_expr_stmt): If want values for statements, convert function to address-of-function. From-SVN: r8679 --- diff --git a/gcc/stmt.c b/gcc/stmt.c index 1ebf1a7ea9d..4d3ed87e4f0 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,