On Tue, Nov 01, 2016 at 09:44:27PM +0100, Rainer Orth wrote:
> this patch broke Solaris bootstrap with /bin/as:
> 
> /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c: In function 'void 
> output_rnglists()':
> /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:11055:8: error: unused variable 
> 'basebuf' [-Werror=unused-variable]
>    char basebuf[MAX_ARTIFICIAL_LABEL_BYTES];
>         ^~~~~~~
> /vol/gcc/src/hg/trunk/local/gcc/dwarf2out.c:11088:16: error: unused variable 
> 'len' [-Werror=unused-variable]
>    unsigned int len = vec_safe_length (ranges_table);
>                 ^~~
> 
> Fixed as follows; will commit as obvious once i386-pc-solaris2.12 and
> sparc-sun-solaris2.12 bootstrap have finished successfully.

> 2016-11-01  Rainer Orth  <r...@cebitec.uni-bielefeld.de>
> 
>       * dwarf2out.c (output_rnglists): Wrap basebuf, len in
>       HAVE_AS_LEB128.

Thanks, sorry for not testing it without HAVE_AS_LEB128
(the loclists patch I've tested by temporarily changing
HAVE_AS_LEB128 to HAVE_AS_LEB128X, but forgot to do that
with this patch).

> --- a/gcc/dwarf2out.c
> +++ b/gcc/dwarf2out.c
> @@ -11052,7 +11052,9 @@ output_rnglists (void)
>    dw_ranges *r;
>    char l1[MAX_ARTIFICIAL_LABEL_BYTES];
>    char l2[MAX_ARTIFICIAL_LABEL_BYTES];
> +#ifdef HAVE_AS_LEB128
>    char basebuf[MAX_ARTIFICIAL_LABEL_BYTES];
> +#endif
>  
>    switch_to_section (debug_ranges_section);
>    ASM_OUTPUT_LABEL (asm_out_file, ranges_section_label);
> @@ -11085,9 +11087,9 @@ output_rnglists (void)
>                               ranges_base_label, NULL);
>      }
>  
> -  unsigned int len = vec_safe_length (ranges_table);
>    const char *lab = "";
>  #ifdef HAVE_AS_LEB128
> +  unsigned int len = vec_safe_length (ranges_table);
>    const char *base = NULL;
>  #endif
>    FOR_EACH_VEC_SAFE_ELT (ranges_table, i, r)


        Jakub

Reply via email to