[Bug bootstrap/81033] [8 Regression] Revision r249019 breaks bootstrap on darwin

egall at gwmail dot gwu.edu gcc-bugzilla@gcc.gnu.org
Wed Jul 5 15:57:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81033

--- Comment #18 from Eric Gallager <egall at gwmail dot gwu.edu> ---
(In reply to Dominique d'Humieres from comment #10)
> The last patch in comment 8 exposes another problem: buf[128] is too small.
> 
> The following patch which uses the trick proposed in IRC by Richi to split
> assemble_name_raw seems to work
> 
> --- ../_clean/gcc/config/darwin.c	2017-01-01 17:39:06.000000000 +0100
> +++ gcc/config/darwin.c	2017-07-03 14:21:19.000000000 +0200
> @@ -3683,11 +3683,9 @@ default_function_sections:
>  void
>  darwin_function_switched_text_sections (FILE *fp, tree decl, bool
> new_is_cold)
>  {
> -  char buf[128];
> -  snprintf (buf, 128, "%s%s",new_is_cold?"__cold_sect_of_":"__hot_sect_of_",
> -	    IDENTIFIER_POINTER (DECL_NAME (decl)));
>    /* Make sure we pick up all the relevant quotes etc.  */
> -  assemble_name_raw (fp, (const char *) buf);
> +  assemble_name_raw (fp, new_is_cold?"__cold_sect_of_":"__hot_sect_of_");
> +  assemble_name_raw (fp, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
>    fputs (":\n", fp);
>  }

I successfully bootstrapped with this patch; the test results produced by it
can be found here: https://gcc.gnu.org/ml/gcc-testresults/2017-07/msg00365.html


More information about the Gcc-bugs mailing list