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: [PATCH] New fixes for hot/cold partitioning



On Apr 6, 2005, at 3:12 PM, Zack Weinberg wrote:


Caroline Tice <ctice@apple.com> writes:

!       cfun = DECL_STRUCT_FUNCTION (current_function_decl);
!       if (!cfun->unlikely_text_section_name)
  	{
! 	  if (flag_function_sections
! 	      && DECL_SECTION_NAME (current_function_decl))
! 	    {
! 	      name = xstrdup (TREE_STRING_POINTER (DECL_SECTION_NAME
! 						   (current_function_decl)));
! 	      stripped_name = targetm.strip_name_encoding (name);
! 	      len = strlen (stripped_name);
! 	      buffer = (char *) xmalloc (len + 10);
! 	      sprintf (buffer, "%s%s", stripped_name, "_unlikely");
! 	      cfun->unlikely_text_section_name = ggc_strdup (buffer);
! 	      free (buffer);
! 	      free (name);
! 	      free (strippped_name);
! 	    }

It is not correct to free stripped_name. Most targetm.strip_name_encoding definitions modify their argument in place. You should have checked this yourself.



Mea culpa. I'm sorry. If I remove that statement, and this revised patch passes all the tests, is this okay to commit?

-- Caroline
ctice@apple.com


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