aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-04-11 08:24:56 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-04-11 08:24:56 -0400
commit43198be7c4cf49f0ba7fcdbe3d5558b47f0ad0a2 (patch)
tree5563c8a4eeba0341ecb85d0ffc2037f1664d4faf
parentd80db03db2a63a855abb27ae3f236e8d27c7c227 (diff)
downloadgcc-43198be7c4cf49f0ba7fcdbe3d5558b47f0ad0a2.zip
gcc-43198be7c4cf49f0ba7fcdbe3d5558b47f0ad0a2.tar.gz
gcc-43198be7c4cf49f0ba7fcdbe3d5558b47f0ad0a2.tar.bz2
(preexpand_calls, case CALL_EXPR): Rework to properly avoid expanding
functions returning variable size objects. From-SVN: r11698
-rw-r--r--gcc/expr.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index f470bd5..851c18e 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9422,16 +9422,17 @@ preexpand_calls (exp)
{
case CALL_EXPR:
/* Do nothing if already expanded. */
- if (CALL_EXPR_RTL (exp) != 0)
+ if (CALL_EXPR_RTL (exp) != 0
+ /* Do nothing if the call returns a variable-sized object. */
+ || TREE_CODE (TYPE_SIZE (TREE_TYPE(exp))) != INTEGER_CST
+ /* Do nothing to built-in functions. */
+ || (TREE_CODE (TREE_OPERAND (exp, 0)) == ADDR_EXPR
+ && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
+ == FUNCTION_DECL)
+ && DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))))
return;
- /* Do nothing to built-in functions. */
- if (TREE_CODE (TREE_OPERAND (exp, 0)) != ADDR_EXPR
- || TREE_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) != FUNCTION_DECL
- || ! DECL_BUILT_IN (TREE_OPERAND (TREE_OPERAND (exp, 0), 0))
- /* Do nothing if the call returns a variable-sized object. */
- || TREE_CODE (TYPE_SIZE (TREE_TYPE(exp))) != INTEGER_CST)
- CALL_EXPR_RTL (exp) = expand_call (exp, NULL_RTX, 0);
+ CALL_EXPR_RTL (exp) = expand_call (exp, NULL_RTX, 0);
return;
case COMPOUND_EXPR: