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]

C++ PATCH to parameter cloning


While debugging another problem, I noticed that the debugger was calling
the 'this' parameter '__in_chrg'.  As it turns out, we were accidentally
copying the source position information from the __in_chrg parameter over
the this parameter of the clone.  Oops.

Mark, do you think this should go into 3.0.3?  AFAIK it only affects
debugging info, but it is a regression and is pretty obvious.

2001-12-13  Jason Merrill  <jason@redhat.com>

	* optimize.c (maybe_clone_body): Fix parameter updating.

*** optimize.c.~1~	Tue Oct  9 16:42:03 2001
--- optimize.c	Thu Dec 13 14:37:27 2001
*************** maybe_clone_body (fn)
*** 181,190 ****
        /* Adjust the parameter names and locations. */
        parm = DECL_ARGUMENTS (fn);
        clone_parm = DECL_ARGUMENTS (clone);
!       /* Update the `this' parameter, which is always first.
! 	 Sometimes, we end update the `this' parameter twice because
! 	 we process it again in the loop below.  That is harmless.  */
        update_cloned_parm (parm, clone_parm);
        if (DECL_HAS_IN_CHARGE_PARM_P (fn))
  	parm = TREE_CHAIN (parm);
        if (DECL_HAS_VTT_PARM_P (fn))
--- 181,190 ----
        /* Adjust the parameter names and locations. */
        parm = DECL_ARGUMENTS (fn);
        clone_parm = DECL_ARGUMENTS (clone);
!       /* Update the `this' parameter, which is always first.  */
        update_cloned_parm (parm, clone_parm);
+       parm = TREE_CHAIN (parm);
+       clone_parm = TREE_CHAIN (clone_parm);
        if (DECL_HAS_IN_CHARGE_PARM_P (fn))
  	parm = TREE_CHAIN (parm);
        if (DECL_HAS_VTT_PARM_P (fn))

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