diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-21 19:08:53 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-04-21 19:08:53 -0400 |
commit | 0207efa210a8cf5c2777b9ebaf3cd0d34295afc5 (patch) | |
tree | 89104da2a7076ab222a77ad3524b8c422a40a8ec /gcc | |
parent | 56f58d3a43c2adf16c117bfcaf94e11324b09184 (diff) | |
download | gcc-0207efa210a8cf5c2777b9ebaf3cd0d34295afc5.zip gcc-0207efa210a8cf5c2777b9ebaf3cd0d34295afc5.tar.gz gcc-0207efa210a8cf5c2777b9ebaf3cd0d34295afc5.tar.bz2 |
(calls_function_1): A language-specific code must be assumed to call a function and also call alloca.
(calls_function_1): A language-specific code must be assumed to call a
function and also call alloca. Check for inlined functions that call
alloca.
From-SVN: r7133
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/calls.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index 1eed04b..2622b5b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -157,27 +157,37 @@ calls_function_1 (exp, which) int which; { register int i; - int type = TREE_CODE_CLASS (TREE_CODE (exp)); - int length = tree_code_length[(int) TREE_CODE (exp)]; + enum tree_code code = TREE_CODE (exp); + int type = TREE_CODE_CLASS (code); + int length = tree_code_length[(int) code]; - /* Only expressions and references can contain calls. */ + /* If this code is langauge-specific, we don't know what it will do. */ + if ((int) code >= NUM_TREE_CODES) + return 1; + /* Only expressions and references can contain calls. */ if (type != 'e' && type != '<' && type != '1' && type != '2' && type != 'r' && type != 'b') return 0; - switch (TREE_CODE (exp)) + switch (code) { case CALL_EXPR: if (which == 0) return 1; else 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)) - && (DECL_FUNCTION_CODE (TREE_OPERAND (TREE_OPERAND (exp, 0), 0)) - == BUILT_IN_ALLOCA)) - return 1; + == FUNCTION_DECL)) + { + tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); + + if ((DECL_BUILT_IN (fndecl) + && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA) + || (DECL_SAVED_INSNS (fndecl) + && (FUNCTION_FLAGS (DECL_SAVED_INSNS (fndecl)) + & FUNCTION_FLAGS_CALLS_ALLOCA))) + return 1; + } /* Third operand is RTL. */ length = 2; |