C++ PATCH: Fix PR 1014

Mark Mitchell mark@codesourcery.com
Wed Apr 11 11:54:00 GMT 2001


The recent patch to throttle ininling missed the case of cloned
constructors and destructors, meaning that PR 1014 still failed.

Fixed with the attached patch.

Tested on i686-pc-linux-gnu, installed on the mainline and on the
branch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2001-04-11  Mark Mitchell  <mark@codesourcery.com>

	* optimize.c (maybe_clone_body): Copy DECL_NUM_STMTS from the
	cloned function to the clone.

Index: optimize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/optimize.c,v
retrieving revision 1.51.2.11
diff -c -p -r1.51.2.11 optimize.c
*** optimize.c	2001/04/06 06:30:09	1.51.2.11
--- optimize.c	2001/04/11 18:38:10
*************** maybe_clone_body (fn)
*** 1114,1119 ****
--- 1114,1123 ----
        /* Actually copy the body.  */
        TREE_CHAIN (DECL_SAVED_TREE (clone)) = copy_body (&id);
  
+       /* There are as many statements in the clone as in the
+ 	 original.  */
+       DECL_NUM_STMTS (clone) = DECL_NUM_STMTS (fn);
+ 
        /* Clean up.  */
        splay_tree_delete (id.decl_map);
        VARRAY_FREE (id.fns);



More information about the Gcc-patches mailing list