Commit 0c4c16df by Jan Hubicka Committed by Jan Hubicka

calls.c (calls_function_1): Propertly handle TREE_LIST expressions; use…

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
parent e6746605
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> Fri Apr 28 16:30:33 2000 Marc Espie <espie@cvs.openbsd.org>
* gcc.texi: Fixes for makeinfo 4.0 --html. * gcc.texi: Fixes for makeinfo 4.0 --html.
......
...@@ -254,11 +254,6 @@ calls_function_1 (exp, which) ...@@ -254,11 +254,6 @@ calls_function_1 (exp, which)
if ((int) code >= NUM_TREE_CODES) if ((int) code >= NUM_TREE_CODES)
return 1; 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) switch (code)
{ {
case CALL_EXPR: case CALL_EXPR:
...@@ -269,12 +264,8 @@ calls_function_1 (exp, which) ...@@ -269,12 +264,8 @@ calls_function_1 (exp, which)
== FUNCTION_DECL)) == FUNCTION_DECL))
{ {
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0); tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
int flags = special_function_p (fndecl, 0);
if ((DECL_BUILT_IN (fndecl) if (flags & ECF_MAY_BE_ALLOCA)
&& 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))
return 1; return 1;
} }
...@@ -311,6 +302,11 @@ calls_function_1 (exp, which) ...@@ -311,6 +302,11 @@ calls_function_1 (exp, which)
return 1; return 1;
} }
return 0; 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: case METHOD_CALL_EXPR:
length = 3; length = 3;
...@@ -322,11 +318,16 @@ calls_function_1 (exp, which) ...@@ -322,11 +318,16 @@ calls_function_1 (exp, which)
case RTL_EXPR: case RTL_EXPR:
return 0; return 0;
default: default:
break; 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++) for (i = 0; i < length; i++)
if (TREE_OPERAND (exp, i) != 0 if (TREE_OPERAND (exp, i) != 0
&& calls_function_1 (TREE_OPERAND (exp, i), which)) && calls_function_1 (TREE_OPERAND (exp, i), which))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment