On 02/14/2017 01:32 PM, Jakub Jelinek wrote:
On Tue, Feb 14, 2017 at 12:15:59PM -0700, Martin Sebor wrote:
That comment explains how the likely_adjust variable ("the adjustment")
is being used, or more precisely, how it was being used in the first
version of the patch. The comment became somewh
On 02/14/2017 06:43 AM, Jakub Jelinek wrote:
On Tue, Feb 14, 2017 at 08:18:13AM +0100, Jakub Jelinek wrote:
On Mon, Feb 13, 2017 at 04:53:19PM -0700, Jeff Law wrote:
dirtype is one of the standard {un,}signed {char,short,int,long,long long}
types, all of them have 0 in their ranges.
For VR_RANG
On 02/14/2017 01:32 PM, Jakub Jelinek wrote:
On Tue, Feb 14, 2017 at 12:15:59PM -0700, Martin Sebor wrote:
That comment explains how the likely_adjust variable ("the adjustment")
is being used, or more precisely, how it was being used in the first
version of the patch. The comment became somewh
On Tue, Feb 14, 2017 at 12:15:59PM -0700, Martin Sebor wrote:
> That comment explains how the likely_adjust variable ("the adjustment")
> is being used, or more precisely, how it was being used in the first
> version of the patch. The comment became somewhat out of date with
> the committed versio
On 02/14/2017 09:39 AM, Jakub Jelinek wrote:
On Tue, Feb 14, 2017 at 09:36:44AM -0700, Martin Sebor wrote:
@@ -1371,7 +1354,8 @@ format_integer (const directive &dir, tr
else
{
res.range.likely = res.range.min;
- if (likely_adjust && maybebase && base != 10)
+ if (maybeb
On Tue, Feb 14, 2017 at 09:36:44AM -0700, Martin Sebor wrote:
> > @@ -1371,7 +1354,8 @@ format_integer (const directive &dir, tr
> >else
> > {
> >res.range.likely = res.range.min;
> > - if (likely_adjust && maybebase && base != 10)
> > + if (maybebase && base != 10
> > +
On 02/14/2017 12:18 AM, Jakub Jelinek wrote:
On Mon, Feb 13, 2017 at 04:53:19PM -0700, Jeff Law wrote:
dirtype is one of the standard {un,}signed {char,short,int,long,long long}
types, all of them have 0 in their ranges.
For VR_RANGE we almost always set res.knownrange to true:
/* Set
On Tue, Feb 14, 2017 at 08:18:13AM +0100, Jakub Jelinek wrote:
> On Mon, Feb 13, 2017 at 04:53:19PM -0700, Jeff Law wrote:
> > > dirtype is one of the standard {un,}signed {char,short,int,long,long long}
> > > types, all of them have 0 in their ranges.
> > > For VR_RANGE we almost always set res.kn
On Mon, Feb 13, 2017 at 04:53:19PM -0700, Jeff Law wrote:
> > dirtype is one of the standard {un,}signed {char,short,int,long,long long}
> > types, all of them have 0 in their ranges.
> > For VR_RANGE we almost always set res.knownrange to true:
> > /* Set KNOWNRANGE if the argument is in
On 02/04/2017 01:07 AM, Jakub Jelinek wrote:
On Fri, Feb 03, 2017 at 05:39:21PM +0100, Jakub Jelinek wrote:
Say in the http://gcc.gnu.org/ml/gcc-patches/2017-02/msg00234.html
patch, you would with my patch need just the tree_digits part,
and then the very last hunk in gimple-ssa-sprintf.c (with
On Sat, Feb 04, 2017 at 09:07:23AM +0100, Jakub Jelinek wrote:
> You've committed the patch unnecessarily complicated, see above.
> The following gives the same testsuite result.
>
> dirtype is one of the standard {un,}signed {char,short,int,long,long long}
> types, all of them have 0 in their ran
On Fri, Feb 03, 2017 at 05:39:21PM +0100, Jakub Jelinek wrote:
> Say in the http://gcc.gnu.org/ml/gcc-patches/2017-02/msg00234.html
> patch, you would with my patch need just the tree_digits part,
> and then the very last hunk in gimple-ssa-sprintf.c (with
> likely_adjust &&
> removed). Because y
On 02/03/2017 12:02 PM, Jeff Law wrote:
On 02/02/2017 05:31 PM, Martin Sebor wrote:
- T (2, "%#hho",a); /* { dg-warning "nul past the end"
} */
- T (2, "%#hhx",a); /* { dg-warning ".%#hhx. directive
writing between 3 and . bytes into a region of size 2" } */
+ T (2, "%
On 02/02/2017 05:49 PM, Martin Sebor wrote:
That is unrelated to the patch, both in the current trunk, with your
patch as well as with my patch there is just
res.range.likely = res.knownrange ? res.range.max : res.range.min;
res.range.unlikely = res.range.max;
for these cases.
Do you want l
On 02/02/2017 05:31 PM, Martin Sebor wrote:
- T (2, "%#hho",a); /* { dg-warning "nul past the end"
} */
- T (2, "%#hhx",a); /* { dg-warning ".%#hhx. directive
writing between 3 and . bytes into a region of size 2" } */
+ T (2, "%#hho",a);
+ T (2, "%#hhx",
On Fri, Feb 03, 2017 at 11:43:53AM -0700, Jeff Law wrote:
> > + if (TREE_CODE (argtype) == POINTER_TYPE)
> > {
> > - if (POINTER_TYPE_P (argtype))
> > - argmax = build_all_ones_cst (argtype);
> > - else if (TYPE_UNSIGNED (argtype))
> > - argmax = TYPE_MAX_VALUE (argtype
On 02/02/2017 03:15 PM, Jakub Jelinek wrote:
Plus there are certain notes removed:
-builtin-sprintf-warn-1.c:1311:3: note: using the range [1, -2147483648] for
directive argument
T (0, "%d", a); /* { dg-warning "into a region" } */
without replacement, here a has [-2147483648,
On 02/02/2017 07:12 AM, Jakub Jelinek wrote:
On Thu, Feb 02, 2017 at 10:52:18AM +0100, Jakub Jelinek wrote:
That said, as I've said in the PR and earlier in December on gcc-patches,
the way format_integer is structured is not really maintainable, has
very different code paths for arguments with
On 02/03/2017 09:39 AM, Jakub Jelinek wrote:
On Fri, Feb 03, 2017 at 09:13:23AM -0700, Martin Sebor wrote:
I'm not opposed to the changes, certainly not to cleaning things up,
but I don't think now is the time to be making these tweaks. Jakub's
patch is fine with me without those tweaks, and wi
On Fri, Feb 03, 2017 at 10:02:48AM -0700, Martin Sebor wrote:
> On 02/03/2017 09:39 AM, Jakub Jelinek wrote:
> > On Fri, Feb 03, 2017 at 09:13:23AM -0700, Martin Sebor wrote:
> > > I'm not opposed to the changes, certainly not to cleaning things up,
> > > but I don't think now is the time to be mak
On 02/03/2017 09:39 AM, Jakub Jelinek wrote:
On Fri, Feb 03, 2017 at 09:13:23AM -0700, Martin Sebor wrote:
I'm not opposed to the changes, certainly not to cleaning things up,
but I don't think now is the time to be making these tweaks. Jakub's
patch is fine with me without those tweaks, and wi
On Fri, Feb 03, 2017 at 09:13:23AM -0700, Martin Sebor wrote:
> I'm not opposed to the changes, certainly not to cleaning things up,
> but I don't think now is the time to be making these tweaks. Jakub's
> patch is fine with me without those tweaks, and with the correction
What do you mean by my
On 02/03/2017 12:35 AM, Jeff Law wrote:
On 02/02/2017 09:58 AM, Martin Sebor wrote:
Otherwise all the tests succeeded, though looking e.g. at the diff
between builtin-sprintf-warn-1.c diagnostics with your patch and with
the patch below instead, there are also differences like:
-builtin-sprintf
On 02/02/2017 09:58 AM, Martin Sebor wrote:
Otherwise all the tests succeeded, though looking e.g. at the diff
between builtin-sprintf-warn-1.c diagnostics with your patch and with
the patch below instead, there are also differences like:
-builtin-sprintf-warn-1.c:1119:3: note: using the range [
On 02/02/2017 05:31 PM, Martin Sebor wrote:
- T (2, "%#hho",a); /* { dg-warning "nul past the end"
} */
- T (2, "%#hhx",a); /* { dg-warning ".%#hhx. directive
writing between 3 and . bytes into a region of size 2" } */
+ T (2, "%#hho",a);
+ T (2, "%#hhx",
On 02/02/2017 04:23 PM, Jakub Jelinek wrote:
On Thu, Feb 02, 2017 at 12:59:11PM -0700, Martin Sebor wrote:
- T (2, "%#hho",a); /* { dg-warning "nul past the end" } */
- T (2, "%#hhx",a); /* { dg-warning ".%#hhx. directive
writing between 3 and . bytes into a region of s
On Thu, Feb 02, 2017 at 05:31:19PM -0700, Martin Sebor wrote:
> index 9e099f0..84dd3671 100644
> --- a/gcc/gimple-ssa-sprintf.c
> +++ b/gcc/gimple-ssa-sprintf.c
> @@ -1242,6 +1242,10 @@ format_integer (const directive &dir, tree arg)
> of the format string by returning [-1, -1]. */
>
- T (2, "%#hho",a); /* { dg-warning "nul past the end" } */
- T (2, "%#hhx",a); /* { dg-warning ".%#hhx. directive
writing between 3 and . bytes into a region of size 2" } */
+ T (2, "%#hho",a);
+ T (2, "%#hhx",a);
On reflection, this isn't quite the r
On Thu, Feb 02, 2017 at 12:59:11PM -0700, Martin Sebor wrote:
> > > - T (2, "%#hho",a); /* { dg-warning "nul past the end" } */
> > > - T (2, "%#hhx",a); /* { dg-warning ".%#hhx. directive
> > > writing between 3 and . bytes into a region of size 2" } */
> > > + T (2, "%#
Hi!
Note, the second patch I've posted passed bootstrap/regtest on both
x86_64-linux and i686-linux.
On Thu, Feb 02, 2017 at 09:58:06AM -0700, Martin Sebor wrote:
> > int
> > main (void)
> > {
> > int i;
> > char buf[64];
> > if (__builtin_sprintf (buf, "%#hho", a) > 1)
> > __builtin_ab
So far I haven't done full bootstrap/regtest on this, just
make check-gcc -j16 -k RUNTESTFLAGS=tree-ssa.exp
which revealed the need for gcc.dg/tree-ssa/builtin-sprintf-warn-1.c hunk
below. Here it is turned into a short wrong-code without the patch
below:
volatile int a;
int
main (void)
{
int
On 02/02/2017 02:52 AM, Jakub Jelinek wrote:
On Thu, Feb 02, 2017 at 08:37:07AM +0100, Jakub Jelinek wrote:
+ if (res.range.max < res.range.min)
+ {
+ unsigned HOST_WIDE_INT tmp = res.range.max;
+ res.range.max = res.range.min;
+ res.range.min = tmp;
These 3
On Thu, Feb 02, 2017 at 10:52:18AM +0100, Jakub Jelinek wrote:
> That said, as I've said in the PR and earlier in December on gcc-patches,
> the way format_integer is structured is not really maintainable, has
> very different code paths for arguments with known ranges and without them
> intermixed
On Thu, Feb 02, 2017 at 08:37:07AM +0100, Jakub Jelinek wrote:
> > + if (res.range.max < res.range.min)
> > + {
> > + unsigned HOST_WIDE_INT tmp = res.range.max;
> > + res.range.max = res.range.min;
> > + res.range.min = tmp;
>
> These 3 lines are
> std::sw
On Wed, Feb 01, 2017 at 04:52:35PM -0700, Martin Sebor wrote:
> --- a/gcc/gimple-ssa-sprintf.c
> +++ b/gcc/gimple-ssa-sprintf.c
> @@ -1382,13 +1382,26 @@ format_integer (const directive &dir, tree arg)
> would reflect the largest possible precision (i.e., INT_MAX). */
>res.range.m
35 matches
Mail list logo