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]

[PATCH] PR1687


Hi,

This is basically is the same patch as the one that just made for 3.3 
(http://gcc.gnu.org/ml/gcc-patches/2003-05/msg00179.html), but with one
new walk_tree also replaced with walk_tree_without_duplicates.

I had plans to merge some of those walks in tree-inline.c, but it
appears that tree walks without duplicates are relatively cheap because
I never really measured any benefit of eliminating one.

Bootstrapped (all except ada) and regtested on i686-pc-linux-gnu.  OK?

I also have a testcase, but I'm unsure about where it should go...

Gr.
Steven


2003-07-03  Steven Bosscher  <steven@gcc.gnu.org>

	PR c/1687
	* tree-inline.c (find_alloca_call): Use
	walk_tree_without_duplicates, instead of walk_tree.
	(find_builtin_longjmp_call): Likewise.
	* c-objc-common.c (c_cannot_inline_fn): Likewise.
	* c-semantics.c (find_reachable_label): Likewise.


Index: c-objc-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-objc-common.c,v
retrieving revision 1.25
diff -c -3 -p -r1.25 c-objc-common.c
*** c-objc-common.c	22 Jun 2003 13:41:24 -0000	1.25
--- c-objc-common.c	3 Jul 2003 20:44:57 -0000
*************** c_cannot_inline_tree_fn (tree *fnp)
*** 211,217 ****
  	return 0;
      }
  
!   if (walk_tree (&DECL_SAVED_TREE (fn), inline_forbidden_p, fn, NULL))
      goto cannot_inline;
  
    return 0;
--- 211,218 ----
  	return 0;
      }
  
!   if (walk_tree_without_duplicates (&DECL_SAVED_TREE (fn),
! 				    inline_forbidden_p, fn))
      goto cannot_inline;
  
    return 0;
Index: c-semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-semantics.c,v
retrieving revision 1.65
diff -c -3 -p -r1.65 c-semantics.c
*** c-semantics.c	1 Jul 2003 18:28:27 -0000	1.65
--- c-semantics.c	3 Jul 2003 20:45:00 -0000
*************** static tree
*** 920,926 ****
  find_reachable_label (tree exp)
  {
    location_t saved_loc = input_location;
!   tree ret = walk_tree (&exp, find_reachable_label_1, NULL, NULL);
    input_location = saved_loc;
    return ret;
  }
--- 920,927 ----
  find_reachable_label (tree exp)
  {
    location_t saved_loc = input_location;
!   tree ret = walk_tree_without_duplicates
! 		(&exp, find_reachable_label_1, NULL);
    input_location = saved_loc;
    return ret;
  }
Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.64
diff -c -3 -p -r1.64 tree-inline.c
*** tree-inline.c	1 Jul 2003 12:18:01 -0000	1.64
--- tree-inline.c	3 Jul 2003 20:45:04 -0000
*************** find_alloca_call (exp)
*** 926,932 ****
       tree exp;
  {
    location_t saved_loc = input_location;
!   tree ret = walk_tree (&exp, find_alloca_call_1, NULL, NULL);
    input_location = saved_loc;
    return ret;
  }
--- 926,933 ----
       tree exp;
  {
    location_t saved_loc = input_location;
!   tree ret = walk_tree_without_duplicates
! 		(&exp, find_alloca_call_1, NULL);
    input_location = saved_loc;
    return ret;
  }
*************** find_builtin_longjmp_call (exp)
*** 955,961 ****
       tree exp;
  {
    location_t saved_loc = input_location;
!   tree ret = walk_tree (&exp, find_builtin_longjmp_call_1, NULL, NULL);
    input_location = saved_loc;
    return ret;
  }
--- 956,963 ----
       tree exp;
  {
    location_t saved_loc = input_location;
!   tree ret = walk_tree_without_duplicates
! 		(&exp, find_builtin_longjmp_call_1, NULL);
    input_location = saved_loc;
    return ret;
  }

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