public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH][OBVIOUS] Fix wrong usage of dump_printf_loc (PR tree-optimization/90416).
@ 2019-05-13 10:20 Martin Liška
  2019-05-13 11:19 ` Richard Sandiford
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2019-05-13 10:20 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

Hi.

dump_printf_loc is a variadic function and the usafe in tree-vect-stmts.c
is wrongly passing 2nd part of the string format as a first variadic argument.
That's why I saw such a strange crashes.

I'm going to install the patch as soon as it finishes tests.

Thanks,
Martin

gcc/ChangeLog:

2019-05-13  Martin Liska  <mliska@suse.cz>

	PR tree-optimization/90416
	* tree-vect-stmts.c (vect_check_load_store_mask): Concatenate
	string instead of passing the second part as va_arg argument.
---
 gcc/tree-vect-stmts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[-- Attachment #2: 0001-Fix-wrong-usage-of-dump_printf_loc-PR-tree-optimizat.patch --]
[-- Type: text/x-patch, Size: 469 bytes --]

diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index ced4264722c..4ed60808a65 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -2592,7 +2592,7 @@ vect_check_load_store_mask (stmt_vec_info stmt_info, tree mask,
     {
       if (dump_enabled_p ())
 	dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
-			 "vector mask type %T",
+			 "vector mask type %T"
 			 " does not match vector data type %T.\n",
 			 mask_vectype, vectype);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][OBVIOUS] Fix wrong usage of dump_printf_loc (PR tree-optimization/90416).
  2019-05-13 10:20 [PATCH][OBVIOUS] Fix wrong usage of dump_printf_loc (PR tree-optimization/90416) Martin Liška
@ 2019-05-13 11:19 ` Richard Sandiford
  2019-05-13 11:20   ` Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Sandiford @ 2019-05-13 11:19 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches, David Malcolm

Martin Liška <mliska@suse.cz> writes:
> Hi.
>
> dump_printf_loc is a variadic function and the usafe in tree-vect-stmts.c
> is wrongly passing 2nd part of the string format as a first variadic argument.
> That's why I saw such a strange crashes.
>
> I'm going to install the patch as soon as it finishes tests.

Good catch!  Mind applying to gcc-9-branch too?

Thanks,
Richard

>
> Thanks,
> Martin
>
> gcc/ChangeLog:
>
> 2019-05-13  Martin Liska  <mliska@suse.cz>
>
> 	PR tree-optimization/90416
> 	* tree-vect-stmts.c (vect_check_load_store_mask): Concatenate
> 	string instead of passing the second part as va_arg argument.
> ---
>  gcc/tree-vect-stmts.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
>
> diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
> index ced4264722c..4ed60808a65 100644
> --- a/gcc/tree-vect-stmts.c
> +++ b/gcc/tree-vect-stmts.c
> @@ -2592,7 +2592,7 @@ vect_check_load_store_mask (stmt_vec_info stmt_info, tree mask,
>      {
>        if (dump_enabled_p ())
>  	dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
> -			 "vector mask type %T",
> +			 "vector mask type %T"
>  			 " does not match vector data type %T.\n",
>  			 mask_vectype, vectype);
>  

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH][OBVIOUS] Fix wrong usage of dump_printf_loc (PR tree-optimization/90416).
  2019-05-13 11:19 ` Richard Sandiford
@ 2019-05-13 11:20   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2019-05-13 11:20 UTC (permalink / raw)
  To: gcc-patches, David Malcolm, richard.sandiford

On 5/13/19 1:19 PM, Richard Sandiford wrote:
> Martin Liška <mliska@suse.cz> writes:
>> Hi.
>>
>> dump_printf_loc is a variadic function and the usafe in tree-vect-stmts.c
>> is wrongly passing 2nd part of the string format as a first variadic argument.
>> That's why I saw such a strange crashes.
>>
>> I'm going to install the patch as soon as it finishes tests.
> 
> Good catch!  Mind applying to gcc-9-branch too?

Thanks.

I'm going to backport that!

Martin

> 
> Thanks,
> Richard
> 
>>
>> Thanks,
>> Martin
>>
>> gcc/ChangeLog:
>>
>> 2019-05-13  Martin Liska  <mliska@suse.cz>
>>
>> 	PR tree-optimization/90416
>> 	* tree-vect-stmts.c (vect_check_load_store_mask): Concatenate
>> 	string instead of passing the second part as va_arg argument.
>> ---
>>  gcc/tree-vect-stmts.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>
>> diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
>> index ced4264722c..4ed60808a65 100644
>> --- a/gcc/tree-vect-stmts.c
>> +++ b/gcc/tree-vect-stmts.c
>> @@ -2592,7 +2592,7 @@ vect_check_load_store_mask (stmt_vec_info stmt_info, tree mask,
>>      {
>>        if (dump_enabled_p ())
>>  	dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
>> -			 "vector mask type %T",
>> +			 "vector mask type %T"
>>  			 " does not match vector data type %T.\n",
>>  			 mask_vectype, vectype);
>>  

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-13 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 10:20 [PATCH][OBVIOUS] Fix wrong usage of dump_printf_loc (PR tree-optimization/90416) Martin Liška
2019-05-13 11:19 ` Richard Sandiford
2019-05-13 11:20   ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).