(expand_expr_stmt): If want values for statements, convert function to
authorRichard Kenner <kenner@gcc.gnu.org>
Wed, 21 Dec 1994 17:50:57 +0000 (12:50 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Wed, 21 Dec 1994 17:50:57 +0000 (12:50 -0500)
address-of-function.

From-SVN: r8679

gcc/stmt.c

index 1ebf1a7ea9d79c07257990b578033da6c5e0d307..4d3ed87e4f0a820ffb023dc23dddf35db0f666ee 100644 (file)
@@ -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,