This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cleanup leftover non-local variable checks


On Thu, Aug 05, 2004 at 03:37:15PM +0200, Ulrich Weigand wrote:
> This apparently has the effect of disabling tail calls in any
> function that uses any (non-static) global variable; e.g.
> dwarf2_name in dwarf2out.c no longer uses a tail call.

Fixed.


r~


        * tree-tailcall.c (suitable_for_tail_opt_p): Also check DECL_EXTERNAL.

Index: tree-tailcall.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-tailcall.c,v
retrieving revision 2.20
diff -c -p -d -u -r2.20 tree-tailcall.c
--- tree-tailcall.c	5 Aug 2004 08:41:57 -0000	2.20
+++ tree-tailcall.c	11 Aug 2004 03:55:41 -0000
@@ -143,7 +143,7 @@ suitable_for_tail_opt_p (void)
     {
       tree var = VARRAY_TREE (referenced_vars, i);
 
-      if (!TREE_STATIC (var)
+      if (!(TREE_STATIC (var) || DECL_EXTERNAL (var))
 	  && var_ann (var)->mem_tag_kind == NOT_A_TAG
 	  && is_call_clobbered (var))
 	return false;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]