aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-sprintf.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-12-19 22:06:04 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-12-19 22:06:04 +0100
commit281cbf31893671e3ab8bf0f1ba9eddd297176047 (patch)
tree13778fa775e46b0088367c074d8099c83f6500c3 /gcc/gimple-ssa-sprintf.c
parent64cc30c5ee15d8987cb565bccd9d29fad7b7a567 (diff)
downloadgcc-281cbf31893671e3ab8bf0f1ba9eddd297176047.zip
gcc-281cbf31893671e3ab8bf0f1ba9eddd297176047.tar.gz
gcc-281cbf31893671e3ab8bf0f1ba9eddd297176047.tar.bz2
gimple-ssa-sprintf.c (format_directive): Use inform_n instead of inform with hardcoded english plural handling.
* gimple-ssa-sprintf.c (format_directive): Use inform_n instead of inform with hardcoded english plural handling. From-SVN: r255840
Diffstat (limited to 'gcc/gimple-ssa-sprintf.c')
-rw-r--r--gcc/gimple-ssa-sprintf.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/gimple-ssa-sprintf.c b/gcc/gimple-ssa-sprintf.c
index eddc20e..4275755 100644
--- a/gcc/gimple-ssa-sprintf.c
+++ b/gcc/gimple-ssa-sprintf.c
@@ -2933,13 +2933,15 @@ format_directive (const sprintf_dom_walker::call_info &info,
if (warned && fmtres.range.min < fmtres.range.likely
&& fmtres.range.likely < fmtres.range.max)
- {
- inform (info.fmtloc,
- (1 == fmtres.range.likely
- ? G_("assuming directive output of %wu byte")
- : G_("assuming directive output of %wu bytes")),
+ /* Some languages have special plural rules even for large values,
+ but it is periodic with period of 10, 100, 1000 etc. */
+ inform_n (info.fmtloc,
+ fmtres.range.likely > INT_MAX
+ ? (fmtres.range.likely % 1000000) + 1000000
+ : fmtres.range.likely,
+ "assuming directive output of %wu byte",
+ "assuming directive output of %wu bytes",
fmtres.range.likely);
- }
if (warned && fmtres.argmin)
{