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]

cc1plus cores


The compiler runs much better when functions don't clobber
their return addresses.


r~

	* pt.c (process_partial_specialization): Consistantly allocate
	and zero tpd.parms based on ntparms.

Index: pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.200
diff -c -p -d -r1.200 pt.c
*** pt.c	1998/09/06 19:45:04	1.200
--- pt.c	1998/09/08 09:03:07
*************** process_partial_specialization (decl)
*** 1912,1918 ****
       or some such would have been OK.  */
    tpd.level = TMPL_PARMS_DEPTH (current_template_parms);
    tpd.parms = alloca (sizeof (int) * ntparms);
!   bzero (tpd.parms, sizeof (int) * nargs);
  
    tpd.arg_uses_template_parms = alloca (sizeof (int) * nargs);
    bzero (tpd.arg_uses_template_parms, sizeof (int) * nargs);
--- 1912,1918 ----
       or some such would have been OK.  */
    tpd.level = TMPL_PARMS_DEPTH (current_template_parms);
    tpd.parms = alloca (sizeof (int) * ntparms);
!   bzero (tpd.parms, sizeof (int) * ntparms);
  
    tpd.arg_uses_template_parms = alloca (sizeof (int) * nargs);
    bzero (tpd.arg_uses_template_parms, sizeof (int) * nargs);
*************** process_partial_specialization (decl)
*** 1985,1991 ****
  		  /* We haven't yet initialized TPD2.  Do so now.  */
  		  tpd2.arg_uses_template_parms 
  		    =  (int*) alloca (sizeof (int) * nargs);
! 		  tpd2.parms = (int*) alloca (sizeof (int) * nargs);
  		  tpd2.level = 
  		    TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (maintmpl));
  		}
--- 1985,1991 ----
  		  /* We haven't yet initialized TPD2.  Do so now.  */
  		  tpd2.arg_uses_template_parms 
  		    =  (int*) alloca (sizeof (int) * nargs);
! 		  tpd2.parms = (int*) alloca (sizeof (int) * ntparms);
  		  tpd2.level = 
  		    TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (maintmpl));
  		}
*************** process_partial_specialization (decl)
*** 1995,2001 ****
  		 template, not in the specialization.  */
  	      tpd2.current_arg = i;
  	      tpd2.arg_uses_template_parms[i] = 0;
! 	      bzero (tpd.parms, sizeof (int) * nargs);
  	      for_each_template_parm (type,
  				      &mark_template_parm,
  				      &tpd2);
--- 1995,2001 ----
  		 template, not in the specialization.  */
  	      tpd2.current_arg = i;
  	      tpd2.arg_uses_template_parms[i] = 0;
! 	      bzero (tpd.parms, sizeof (int) * ntparms);
  	      for_each_template_parm (type,
  				      &mark_template_parm,
  				      &tpd2);


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