aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2003-03-05 23:19:33 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2003-03-05 22:19:33 +0000
commitb255a03659c00eef213ffbeab6ce371f56e089e7 (patch)
tree6d8310470c10ca87b4dc63ecaa076fb112326f11 /gcc/calls.c
parent0eb933a0d0199d0c42da23f3b49880fee7d63358 (diff)
downloadgcc-b255a03659c00eef213ffbeab6ce371f56e089e7.zip
gcc-b255a03659c00eef213ffbeab6ce371f56e089e7.tar.gz
gcc-b255a03659c00eef213ffbeab6ce371f56e089e7.tar.bz2
Makefile.in (calls.o, [...]): Depend on cgraph.h
* Makefile.in (calls.o, toplev.o alias.o): Depend on cgraph.h * alias.c: Include cgraph.h (mark_constant_function): Use cgraph_rtl_info. * calls.c: Include cgraph.h (flags_from_decl_or_type): Use cgraph_rtl_info to find pure and const calls. (expand_call): Use cgraph_rtl_info to set preferred stack boundary. * cgraph.c (cgraph_rtl_info): New function. * cgraph.h (cgraph_rtl_info): Declare (cgraph_rtl_info): Likewise. * function.h (struct function): Add recursive_call_emit. * toplev.c: Include cgraph.h. (rest_of_compilation): Set preferred_incoming_stack_boundary. * gcc.dg/i386-local2.c: New. From-SVN: r63868
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 57470b2..509a689 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "sbitmap.h"
#include "langhooks.h"
#include "target.h"
+#include "cgraph.h"
/* Decide whether a function's arguments should be processed
from first to last or from last to first.
@@ -798,8 +799,14 @@ flags_from_decl_or_type (exp)
/* ??? We can't set IS_MALLOC for function types? */
if (DECL_P (exp))
{
+ struct cgraph_rtl_info *i = cgraph_rtl_info (exp);
type = TREE_TYPE (exp);
+ if (i && i->pure_function)
+ flags |= ECF_PURE | ECF_LIBCALL_BLOCK;
+ if (i && i->const_function)
+ flags |= ECF_CONST | ECF_LIBCALL_BLOCK;
+
/* The function exp may have the `malloc' attribute. */
if (DECL_P (exp) && DECL_IS_MALLOC (exp))
flags |= ECF_MALLOC;
@@ -2344,6 +2351,12 @@ expand_call (exp, target, ignore)
/* Figure out the amount to which the stack should be aligned. */
preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
+ if (fndecl)
+ {
+ struct cgraph_rtl_info *i = cgraph_rtl_info (fndecl);
+ if (i && i->preferred_incoming_stack_boundary)
+ preferred_stack_boundary = i->preferred_incoming_stack_boundary;
+ }
/* Operand 0 is a pointer-to-function; get the type of the function. */
funtype = TREE_TYPE (addr);
@@ -2630,6 +2643,8 @@ expand_call (exp, target, ignore)
if (cfun->preferred_stack_boundary < preferred_stack_boundary
&& fndecl != current_function_decl)
cfun->preferred_stack_boundary = preferred_stack_boundary;
+ if (fndecl == current_function_decl)
+ cfun->recursive_call_emit = true;
preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT;