mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-06 11:40:50 +08:00
gimple-ssa-sprintf.c (format_integer): Set knownrange when it's known.
gcc/ChangeLog: * gimple-ssa-sprintf.c (format_integer): Set knownrange when it's known. gcc/testsuite/ChangeLog: * tree-ssa/builtin-sprintf-warn-18.c: Adjust to avoid failures on ILP32 targets. From-SVN: r247444
This commit is contained in:
parent
d539a57b06
commit
4d82d0bc43
@ -1,3 +1,8 @@
|
||||
2017-05-01 Martin Sebor <msebor@redhat.com>
|
||||
|
||||
* gimple-ssa-sprintf.c (format_integer): Set knownrange when it's
|
||||
known.
|
||||
|
||||
2017-05-01 Uros Bizjak <ubizjak@gmail.com>
|
||||
|
||||
PR target/68491
|
||||
|
@ -1390,6 +1390,7 @@ format_integer (const directive &dir, tree arg)
|
||||
res.range.max = tree_digits (arg, base, dir.prec[1],
|
||||
maybesign, maybebase);
|
||||
res.range.likely = res.range.min;
|
||||
res.knownrange = true;
|
||||
}
|
||||
|
||||
res.range.unlikely = res.range.max;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2017-05-01 Martin Sebor <msebor@redhat.com>
|
||||
|
||||
* tree-ssa/builtin-sprintf-warn-18.c: Adjust to avoid failures
|
||||
on ILP32 targets.
|
||||
|
||||
2017-05-01 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
* gcc.dg/pr78768.c: Require linker plugin.
|
||||
|
@ -114,18 +114,15 @@ void test_characters ()
|
||||
|
||||
void test_width_and_precision_out_of_range (char *d)
|
||||
{
|
||||
#if __LONG_MAX__ == 2147483647
|
||||
# define MAX_P1_STR "2147483648"
|
||||
#elif __LONG_MAX__ == 9223372036854775807
|
||||
# define MAX_P1_STR "9223372036854775808"
|
||||
#endif
|
||||
|
||||
T ("%" MAX_P1_STR "i", 0); /* { dg-warning "width out of range" } */
|
||||
/* { dg-warning "result to exceed .INT_MAX. " "" { target *-*-* } .-1 } */
|
||||
T ("%." MAX_P1_STR "i", 0); /* { dg-warning "precision out of range" } */
|
||||
/* The range here happens to be a property of the compiler, not
|
||||
one of the target. */
|
||||
T ("%9223372036854775808i", 0); /* { dg-warning "width out of range" } */
|
||||
/* { dg-warning "result to exceed .INT_MAX." "" { target *-*-* } .-1 } */
|
||||
T ("%.9223372036854775808i", 0); /* { dg-warning "precision out of range" } */
|
||||
/* { dg-warning "causes result to exceed .INT_MAX." "" { target *-*-* } .-1 } */
|
||||
|
||||
/* The following is diagnosed by -Wformat (disabled here). */
|
||||
/* T ("%" MAX_P1_STR "$i", 0); */
|
||||
/* T ("%9223372036854775808$i", 0); */
|
||||
}
|
||||
|
||||
/* Verify that an excessively long directive is truncated and the truncation
|
||||
|
Loading…
x
Reference in New Issue
Block a user