aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2000-04-28 23:17:41 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2000-04-28 23:17:41 +0000
commit0c4c16df3e0184bb42f56b292b969bb52572b861 (patch)
tree4b85e24b0504e6b7c8f4c363d86c02170f39cdbd
parente67466053bf8586ccc0d1593e713422ceb540798 (diff)
downloadgcc-0c4c16df3e0184bb42f56b292b969bb52572b861.zip
gcc-0c4c16df3e0184bb42f56b292b969bb52572b861.tar.gz
gcc-0c4c16df3e0184bb42f56b292b969bb52572b861.tar.bz2
calls.c (calls_function_1): Propertly handle TREE_LIST expressions; use special_function_p to detect alloca.
* calls.c (calls_function_1): Propertly handle TREE_LIST expressions; use special_function_p to detect alloca. From-SVN: r33528
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/calls.c25
2 files changed, 18 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 659a3bd..4def625 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Sat Apr 29 01:15:27 MET DST 2000 Jan Hubicka <jh@suse.cz>
+
+ * calls.c (calls_function_1): Propertly handle TREE_LIST expressions;
+ use special_function_p to detect alloca.
+
Fri Apr 28 16:30:33 2000 Marc Espie <espie@cvs.openbsd.org>
* gcc.texi: Fixes for makeinfo 4.0 --html.
diff --git a/gcc/calls.c b/gcc/calls.c
index eff0042..78e3f10 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -254,11 +254,6 @@ calls_function_1 (exp, which)
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 (code)
{
case CALL_EXPR:
@@ -269,12 +264,8 @@ calls_function_1 (exp, which)
== FUNCTION_DECL))
{
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
-
- if ((DECL_BUILT_IN (fndecl)
- && DECL_BUILT_IN_CLASS (fndecl) == BUILT_IN_NORMAL
- && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_ALLOCA)
- || (DECL_SAVED_INSNS (fndecl)
- && DECL_SAVED_INSNS (fndecl)->calls_alloca))
+ int flags = special_function_p (fndecl, 0);
+ if (flags & ECF_MAY_BE_ALLOCA)
return 1;
}
@@ -311,6 +302,11 @@ calls_function_1 (exp, which)
return 1;
}
return 0;
+ case TREE_LIST:
+ for (; exp != 0; exp = TREE_CHAIN (exp))
+ if (calls_function_1 (TREE_VALUE (exp), which))
+ return 1;
+ return 0;
case METHOD_CALL_EXPR:
length = 3;
@@ -322,11 +318,16 @@ calls_function_1 (exp, which)
case RTL_EXPR:
return 0;
-
+
default:
break;
}
+ /* Only expressions and references can contain calls. */
+ if (type != 'e' && type != '<' && type != '1' && type != '2' && type != 'r'
+ && type != 'b')
+ return 0;
+
for (i = 0; i < length; i++)
if (TREE_OPERAND (exp, i) != 0
&& calls_function_1 (TREE_OPERAND (exp, i), which))