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 v2] gcc/dwarf2asm.c: Add dw2_asm_voutput_delta() with var_list for dw2_asm_output_delta()


Hello maintainers:

Please help check this patch when you have time, thanks.

BTW: one linux kernel member found a gcc issue for the latest version
(4.10.0 20140622 or later), but for old version (e.g. 4.10.0 2014060*),
it is OK. It is my chance to fix it (hope can finish within 2014-06-30).

Also sorry for I have lost a chance to fix a issue about h8300, because
it is never used for linux main line, it is beyond my border (I have no
enough time resource on it), at present.

Thanks.

On 06/17/2014 09:00 AM, Chen Gang wrote:
> dw2_asm_output_vms_delta() calls dw2_asm_output_delta() in an abnormal
> way, so need add a new function just like vprintf() for printf(), and
> then the related call will be in normal way.
> 
> The related warning:
> 
>   ../../gcc/gcc/dwarf2asm.c: In function ‘void dw2_asm_output_vms_delta(int, const char*, const char*, const char*, ...)’:
>   ../../gcc/gcc/dwarf2asm.c:167:50: warning: format not a string literal and no format arguments [-Wformat-security]
> 
> 
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
>  gcc/ChangeLog   |  6 ++++++
>  gcc/dwarf2asm.c | 21 +++++++++++++--------
>  2 files changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index edb3fc0..01a1cc1 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,9 @@
> +2014-06-14  Chen Gang <gang.chen.5i5j@gmail.com>
> +
> +	* dwarf2asm.c (dw2_asm_output_delta): Add dw2_asm_voutput_delta() for
> +	dw2_asm_output_delta(), just like vprintf() for printf(), so that
> +	dw2_asm_output_vms_delta() can use it in normal way.
> +
>  2014-06-13  Vladimir Makarov  <vmakarov@redhat.com>
>  
>  	* lra-assign.c (assign_by_spills): Add code to assign vector regs
> diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c
> index 1372b23..376b939 100644
> --- a/gcc/dwarf2asm.c
> +++ b/gcc/dwarf2asm.c
> @@ -123,14 +123,10 @@ dw2_asm_output_data (int size, unsigned HOST_WIDE_INT value,
>     impossible to do here, since the ASM_SET_OP for the difference
>     symbol must appear after both symbols are defined.  */
>  
> -void
> -dw2_asm_output_delta (int size, const char *lab1, const char *lab2,
> -		      const char *comment, ...)
> +static void
> +dw2_asm_voutput_delta (int size, const char *lab1, const char *lab2,
> +		      const char *comment, va_list ap)
>  {
> -  va_list ap;
> -
> -  va_start (ap, comment);
> -
>  #ifdef ASM_OUTPUT_DWARF_DELTA
>    ASM_OUTPUT_DWARF_DELTA (asm_out_file, size, lab1, lab2);
>  #else
> @@ -145,7 +141,16 @@ dw2_asm_output_delta (int size, const char *lab1, const char *lab2,
>        vfprintf (asm_out_file, comment, ap);
>      }
>    fputc ('\n', asm_out_file);
> +}
>  
> +void
> +dw2_asm_output_delta (int size, const char *lab1, const char *lab2,
> +		      const char *comment, ...)
> +{
> +  va_list ap;
> +
> +  va_start (ap, comment);
> +  dw2_asm_voutput_delta (size, lab1, lab2, comment, ap);
>    va_end (ap);
>  }
>  
> @@ -164,7 +169,7 @@ dw2_asm_output_vms_delta (int size ATTRIBUTE_UNUSED,
>  #ifndef ASM_OUTPUT_DWARF_VMS_DELTA
>    /* VMS Delta is only special on ia64-vms, but this function also gets
>       called on alpha-vms so it has to do something sane.  */
> -  dw2_asm_output_delta (size, lab1, lab2, comment);
> +  dw2_asm_voutput_delta (size, lab1, lab2, comment, ap);
>  #else
>    ASM_OUTPUT_DWARF_VMS_DELTA (asm_out_file, size, lab1, lab2);
>    if (flag_debug_asm && comment)
> 


-- 
Chen Gang

Open share and attitude like air water and life which God blessed


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