Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-14 Thread Qing Zhao
> On Dec 14, 2017, at 1:36 PM, Jeff Law wrote: > > On 12/14/2017 12:22 PM, Qing Zhao wrote: >> >>> On Dec 14, 2017, at 2:05 AM, Richard Biener >> > wrote: >>> >>> On Wed, 13 Dec 2017, Qing Zhao wrote: >>> Hi, I

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-14 Thread Jeff Law
On 12/14/2017 12:22 PM, Qing Zhao wrote: > >> On Dec 14, 2017, at 2:05 AM, Richard Biener > > wrote: >> >> On Wed, 13 Dec 2017, Qing Zhao wrote: >> >>> Hi, >>> >>> I updated gimple-fold.c as you suggested, bootstrapped and re-tested >>> on both x86

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-14 Thread Qing Zhao
> On Dec 14, 2017, at 2:05 AM, Richard Biener wrote: > > On Wed, 13 Dec 2017, Qing Zhao wrote: > >> Hi, >> >> I updated gimple-fold.c as you suggested, bootstrapped and re-tested on both >> x86 and aarch64. no any issue. >> >> >> diff --git a/gcc/gimple-fold.c

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-14 Thread Richard Biener
On Wed, 13 Dec 2017, Qing Zhao wrote: > Hi, > > I updated gimple-fold.c as you suggested, bootstrapped and re-tested on both > x86 and aarch64. no any issue. > > > diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c > index 353a46e..eb6a87a 100644 > --- a/gcc/gimple-fold.c > +++

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-13 Thread Qing Zhao
Hi, I updated gimple-fold.c as you suggested, bootstrapped and re-tested on both x86 and aarch64. no any issue. diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 353a46e..eb6a87a 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -1323,6 +1323,19 @@ get_range_strlen (tree

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-12 Thread Martin Sebor
On 12/12/2017 10:56 AM, Qing Zhao wrote: Hi, Martin, thanks for the suggestion, this might be a good enhancement for get_range_strlen for a future work. my understanding is, the current get_range_strlen does not use value range info yet, and also does not handle VLA. we can improve it from

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-12 Thread Qing Zhao
Hi, Martin, thanks for the suggestion, this might be a good enhancement for get_range_strlen for a future work. my understanding is, the current get_range_strlen does not use value range info yet, and also does not handle VLA. we can improve it from both aspects in a later work. Qing >>

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-12 Thread Qing Zhao
> On Dec 12, 2017, at 10:50 AM, Richard Biener wrote: >>> +return false; + val = fold_build2 (MINUS_EXPR, TREE_TYPE (val), val, + integer_one_node); >>> >>> val = wide_int_to_tree (TREE_TYPE (val),

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-12 Thread Martin Sebor
On 12/12/2017 09:13 AM, Qing Zhao wrote: Hi, Richard, thanks a lot for your review. { /* __copy is always the same for characters. Check to see if copy function already exists. */ - sprintf (name, "__copy_character_%d",

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-12 Thread Richard Biener
On December 12, 2017 5:13:19 PM GMT+01:00, Qing Zhao wrote: >Hi, Richard, > >thanks a lot for your review. > >> >>>{ >>> /* __copy is always the same for characters. >>> Check to see if copy function already exists. >*/

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-12 Thread Qing Zhao
Hi, Richard, thanks a lot for your review. > >>{ >> /* __copy is always the same for characters. >> Check to see if copy function already exists. */ >> - sprintf (name, "__copy_character_%d", ts->kind); >> +

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-12 Thread Richard Biener
On Mon, Dec 4, 2017 at 4:34 PM, Qing Zhao wrote: > Hi, > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79538 > > missing -Wformat-overflow with %s and non-member array arguments > > -Wformat-overflow uses the routine

Re: [PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-11 Thread Martin Sebor
On 12/04/2017 08:34 AM, Qing Zhao wrote: Hi, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79538 missing -Wformat-overflow with %s and non-member array arguments -Wformat-overflow uses the routine "get_range_strlen" to decide the maximum

[PATCH][Middle-end]79538 missing -Wformat-overflow with %s and non-member array arguments

2017-12-04 Thread Qing Zhao
Hi, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79538 missing -Wformat-overflow with %s and non-member array arguments -Wformat-overflow uses the routine "get_range_strlen" to decide the maximum string length, however, currently